Merge branch 'ref_field_to_mongo_bug' of https://github.com/yakxxx/mongoengine
Conflicts: AUTHORS
This commit is contained in:
commit
d7fd6a4628
3 changed files with 12 additions and 1 deletions
|
|
@ -778,7 +778,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