Permalink
Browse files

Revert change to handle .distinct() for referenced documents.

This is causing an issue where mongoengine is trying to dereference
NoneType.
  • Loading branch information...
1 parent 2a34358 commit 436c8b1c11aae05fa7fac5426489c1ac3a28203f @neevor committed Apr 3, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 mongoengine/queryset.py
@@ -1103,8 +1103,9 @@ def distinct(self, field):
.. versionadded:: 0.4
.. versionchanged:: 0.5 - Fixed handling references
"""
- from dereference import DeReference
- return DeReference()(self._cursor.distinct(field), 1)
+ return self._cursor.distinct(field)
+ #from dereference import DeReference
+ #return DeReference()(self._cursor.distinct(field), 1)
def only(self, *fields):
"""Load only a subset of this document's fields. ::

0 comments on commit 436c8b1

Please sign in to comment.