Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #7323 -- Fixed a count() edge-case.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 18d89cc1f759bc926a2fa7a613c46d46fe3ca81f 1 parent 050d0a1
Malcolm Tredinnick authored June 29, 2008
2  django/db/models/sql/query.py
@@ -1484,8 +1484,6 @@ def add_count_column(self):
1484 1484
             if not self.select:
1485 1485
                 select = Count()
1486 1486
             else:
1487  
-                assert len(self.select) == 1, \
1488  
-                        "Cannot add count col with multiple cols in 'select': %r" % self.select
1489 1487
                 select = Count(self.select[0])
1490 1488
         else:
1491 1489
             opts = self.model._meta
4  tests/regressiontests/queries/models.py
@@ -338,6 +338,10 @@ class Related(models.Model):
338 338
 4
339 339
 >>> xx.delete()
340 340
 
  341
+Bug #7323
  342
+>>> Item.objects.values('creator', 'name').count()
  343
+4
  344
+
341 345
 Bug #2253
342 346
 >>> q1 = Item.objects.order_by('name')
343 347
 >>> q2 = Item.objects.filter(id=i1.id)

0 notes on commit 18d89cc

Please sign in to comment.
Something went wrong with that request. Please try again.