Added support for distinct and db_alias (MongoEngine/mongoengine#59)
This commit is contained in:
parent
95b1783834
commit
475488b9f2
5 changed files with 33 additions and 6 deletions
|
|
@ -34,7 +34,9 @@ class DeReference(object):
|
|||
|
||||
doc_type = None
|
||||
if instance and instance._fields:
|
||||
doc_type = instance._fields[name].field
|
||||
doc_type = instance._fields[name]
|
||||
if hasattr(doc_type, 'field'):
|
||||
doc_type = doc_type.field
|
||||
|
||||
if isinstance(doc_type, ReferenceField):
|
||||
doc_type = doc_type.document_type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue