Ticket #11329: sql-get-count-with-select-extra.patch
File sql-get-count-with-select-extra.patch, 701 bytes (added by , 15 years ago) |
---|
-
django/db/models/sql/query.py
360 360 Performs a COUNT() query using the current filter constraints. 361 361 """ 362 362 obj = self.clone() 363 if len(self.select) > 1 or self.aggregate_select :363 if len(self.select) > 1 or self.aggregate_select or self.extra_select: 364 364 # If a select clause exists, then the query has already started to 365 365 # specify the columns that are to be returned. 366 366 # In this case, we need to use a subquery to evaluate the count.