Fixed #7323 -- Fixed a count() edge-case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
050d0a1b75
commit
18d89cc1f7
|
@ -1484,8 +1484,6 @@ class Query(object):
|
||||||
if not self.select:
|
if not self.select:
|
||||||
select = Count()
|
select = Count()
|
||||||
else:
|
else:
|
||||||
assert len(self.select) == 1, \
|
|
||||||
"Cannot add count col with multiple cols in 'select': %r" % self.select
|
|
||||||
select = Count(self.select[0])
|
select = Count(self.select[0])
|
||||||
else:
|
else:
|
||||||
opts = self.model._meta
|
opts = self.model._meta
|
||||||
|
|
|
@ -338,6 +338,10 @@ Bug #1878, #2939
|
||||||
4
|
4
|
||||||
>>> xx.delete()
|
>>> xx.delete()
|
||||||
|
|
||||||
|
Bug #7323
|
||||||
|
>>> Item.objects.values('creator', 'name').count()
|
||||||
|
4
|
||||||
|
|
||||||
Bug #2253
|
Bug #2253
|
||||||
>>> q1 = Item.objects.order_by('name')
|
>>> q1 = Item.objects.order_by('name')
|
||||||
>>> q2 = Item.objects.filter(id=i1.id)
|
>>> q2 = Item.objects.filter(id=i1.id)
|
||||||
|
|
Loading…
Reference in New Issue