Fixed queryset.get() respecting no_dereference (#373)

This commit is contained in:
Ross Lawley 2013-06-21 10:39:10 +00:00
parent f1a1aa54d8
commit e116bb9227
3 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@ Changelog
Changes in 0.8.3
================
- Fixed queryset.get() respecting no_dereference (#373)
- Added full_result kwarg to update (#380)
Changes in 0.8.2

View File

@ -1165,8 +1165,8 @@ class QuerySet(object):
raw_doc = self._cursor.next()
if self._as_pymongo:
return self._get_as_pymongo(raw_doc)
doc = self._document._from_son(raw_doc)
doc = self._document._from_son(raw_doc,
_auto_dereference=self._auto_dereference)
if self._scalar:
return self._get_scalar(doc)

View File

@ -3258,6 +3258,8 @@ class QuerySetTest(unittest.TestCase):
self.assertTrue(isinstance(qs.first().organization, Organization))
self.assertFalse(isinstance(qs.no_dereference().first().organization,
Organization))
self.assertFalse(isinstance(qs.no_dereference().get().organization,
Organization))
self.assertTrue(isinstance(qs.first().organization, Organization))
def test_cached_queryset(self):