bug fix for RefferenceField.to_mongo when dbref=False
This commit is contained in:
parent
c31488add9
commit
787fc1cd8b
2 changed files with 10 additions and 1 deletions
|
|
@ -777,7 +777,7 @@ class ReferenceField(BaseField):
|
|||
def to_mongo(self, document):
|
||||
if isinstance(document, DBRef):
|
||||
if not self.dbref:
|
||||
return DBRef.id
|
||||
return document.id
|
||||
return document
|
||||
elif not self.dbref and isinstance(document, basestring):
|
||||
return document
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue