changeset 125:d2008d4972c1

Added saveable_fields to Container.
author KarstenBock@gmx.net
date Tue, 27 Sep 2011 15:57:36 +0200
parents 0ac4403404ea
children 0ab8b61a8a56
files src/parpg/components/container.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/parpg/components/container.py	Tue Sep 27 15:54:46 2011 +0200
+++ b/src/parpg/components/container.py	Tue Sep 27 15:57:36 2011 +0200
@@ -11,6 +11,8 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+from copy import deepcopy
+
 from base import Base
 
 class Container(Base):
@@ -21,6 +23,13 @@
     def __init__(self):
         Base.__init__(self, children=list, max_bulk=int)
 
+    @property
+    def saveable_fields(self):
+        fields = deepcopy(self.fields)
+        del fields["children"]
+        return fields
+
+
 
 class BulkLimitError(Exception):
     """Error that gets raised when the item would exceed the