Now only removes _id if none, for real
This commit is contained in:
parent
f5e39c0064
commit
3179c4e4ac
@ -414,8 +414,11 @@ class BaseDocument(object):
|
|||||||
self._meta.get('allow_inheritance', True) == False):
|
self._meta.get('allow_inheritance', True) == False):
|
||||||
data['_cls'] = self._class_name
|
data['_cls'] = self._class_name
|
||||||
data['_types'] = self._superclasses.keys() + [self._class_name]
|
data['_types'] = self._superclasses.keys() + [self._class_name]
|
||||||
if hasattr(self, '_id') and not data['_id']:
|
try:
|
||||||
del data['_id']
|
if not data['_id']:
|
||||||
|
del data['_id']
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user