fixed bug for queryset.distinct to work also on embedded documents, not just on lists of embedded documents
This commit is contained in:
		| @@ -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( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user