Removed merge trackers in code, merged correctly now.
This commit is contained in:
parent
20a5d9051d
commit
d92f992c01
@ -1212,18 +1212,11 @@ class QuerySet(object):
|
||||
.. versionchanged:: 0.5 - Fixed handling references
|
||||
.. versionchanged:: 0.6 - Improved db_field refrence handling
|
||||
"""
|
||||
<<<<<<< HEAD
|
||||
field = [field]
|
||||
field = self._fields_to_dbfields(field).pop()
|
||||
return self._dereference(self._cursor.distinct(field), 1,
|
||||
name=field, instance=self._document)
|
||||
=======
|
||||
try:
|
||||
field = self._fields_to_dbfields([field]).pop()
|
||||
finally:
|
||||
return self._dereference(self._cursor.distinct(field), 1,
|
||||
name=field, instance=self._document)
|
||||
>>>>>>> upstream/master
|
||||
|
||||
def only(self, *fields):
|
||||
"""Load only a subset of this document's fields. ::
|
||||
|
@ -2565,18 +2565,6 @@ class QuerySetTest(unittest.TestCase):
|
||||
"""Ensure that distinct resolves field name to db_field as expected.
|
||||
"""
|
||||
class Product(Document):
|
||||
<<<<<<< HEAD
|
||||
product_id=IntField(db_field='pid')
|
||||
|
||||
Product.drop_collection()
|
||||
|
||||
product_one = Product(product_id=1).save()
|
||||
product_two = Product(product_id=2).save()
|
||||
product_one_dup = Product(product_id=1).save()
|
||||
|
||||
self.assertEqual(set(Product.objects.distinct('product_id')),
|
||||
set([1, 2]))
|
||||
=======
|
||||
product_id = IntField(db_field='pid')
|
||||
|
||||
Product.drop_collection()
|
||||
@ -2589,7 +2577,6 @@ class QuerySetTest(unittest.TestCase):
|
||||
set([1, 2]))
|
||||
self.assertEqual(set(Product.objects.distinct('pid')),
|
||||
set([1, 2]))
|
||||
>>>>>>> upstream/master
|
||||
|
||||
Product.drop_collection()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user