fixed bug for queryset.distinct to work also on embedded documents, not just on lists of embedded documents
This commit is contained in:
parent
d27e1eee25
commit
d65ce6fc2c
@ -763,8 +763,7 @@ class BaseQuerySet(object):
|
|||||||
|
|
||||||
# We may need to cast to the correct type eg.
|
# We may need to cast to the correct type eg.
|
||||||
# ListField(EmbeddedDocumentField)
|
# ListField(EmbeddedDocumentField)
|
||||||
doc_field = getattr(
|
doc_field = getattr(self._document._fields.get(field), "field", self._document._fields.get(field))
|
||||||
self._document._fields.get(field), "field", None)
|
|
||||||
instance = getattr(doc_field, "document_type", False)
|
instance = getattr(doc_field, "document_type", False)
|
||||||
EmbeddedDocumentField = _import_class('EmbeddedDocumentField')
|
EmbeddedDocumentField = _import_class('EmbeddedDocumentField')
|
||||||
GenericEmbeddedDocumentField = _import_class(
|
GenericEmbeddedDocumentField = _import_class(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user