# HG changeset patch # User KarstenBock@gmx.net # Date 1317131856 -7200 # Node ID d2008d4972c1d94236a7da7cc4299656a0b5f56f # Parent 0ac4403404ea40fcbaba0915d7836fc7a84fd80a Added saveable_fields to Container. diff -r 0ac4403404ea -r d2008d4972c1 src/parpg/components/container.py --- 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 . +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