Small fixes for GenericReferenceField
This commit is contained in:
parent
233b13d670
commit
3360b72531
@ -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…
x
Reference in New Issue
Block a user