Ticket #15624: aggregate_bug_quick_patch.diff
File aggregate_bug_quick_patch.diff, 869 bytes (added by , 14 years ago) |
---|
-
db/models/sql/query.py
337 337 # over the subquery instead. 338 338 if self.group_by is not None: 339 339 from django.db.models.sql.subqueries import AggregateQuery 340 341 old_mask = self.aggregate_select_mask 342 self.set_aggregate_mask(None) 343 340 344 query = AggregateQuery(self.model) 341 345 342 346 obj = self.clone() … … 348 352 query.aggregate_select[alias] = aggregate 349 353 del obj.aggregate_select[alias] 350 354 355 self.set_aggregate_mask(old_mask) 356 obj.set_aggregate_mask(old_mask) 357 351 358 try: 352 359 query.add_subquery(obj, using) 353 360 except EmptyResultSet: