Mercurial > parpg-source
changeset 95:d67e8288e9bf
Added saveable_fields to Container.
author | KarstenBock@gmx.net |
---|---|
date | Tue, 27 Sep 2011 15:57:36 +0200 |
parents | 5ab004fa4a2e |
children | 8363261b658e |
files | components/container.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/components/container.py Tue Sep 27 15:54:46 2011 +0200 +++ b/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