Merge branch 'patch-8' of https://github.com/wpjunior/mongoengine
This commit is contained in:
commit
43a989978a
1 changed files with 3 additions and 0 deletions
|
|
@ -734,6 +734,9 @@ class GenericReferenceField(BaseField):
|
|||
def to_mongo(self, document):
|
||||
if document is None:
|
||||
return None
|
||||
|
||||
if isinstance(document, (dict, SON)):
|
||||
return document
|
||||
|
||||
id_field_name = document.__class__._meta['id_field']
|
||||
id_field = document.__class__._fields[id_field_name]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue