From bca6119db8c855d120b8a7aae478c895ee54e31c Mon Sep 17 00:00:00 2001 From: Harry Marr Date: Tue, 26 Jan 2010 19:36:19 +0000 Subject: [PATCH] Minor tidyup --- mongoengine/base.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/mongoengine/base.py b/mongoengine/base.py index 83fd34ee..f5a171aa 100644 --- a/mongoengine/base.py +++ b/mongoengine/base.py @@ -345,19 +345,15 @@ class BaseDocument(object): if value is not None: data[field.name] = field.to_mongo(value) # Only add _cls and _types if allow_inheritance is not False - #if not (hasattr(self, '_meta') and - # self._meta.get('allow_inheritance', True) == False): - ah = True - if hasattr(self, '_meta'): - ah = self._meta.get('allow_inheritance', True) - if ah: + if not (hasattr(self, '_meta') and + self._meta.get('allow_inheritance', True) == False): data['_cls'] = self._class_name data['_types'] = self._superclasses.keys() + [self._class_name] return data @classmethod def _from_son(cls, son): - """Create an instance of a Document (subclass) from a PyMongo SOM. + """Create an instance of a Document (subclass) from a PyMongo SON. """ # get the class name from the document, falling back to the given # class if unavailable