Code

Ticket #11104: django.db.models.sql.query.diff

File django.db.models.sql.query.diff, 804 bytes (added by paluh, 4 years ago)

changing grouping generation from values to keys of extra selects

Line 
1Index: django/db/models/sql/query.py
2===================================================================
3--- django/db/models/sql/query.py       (revision 11729)
4+++ django/db/models/sql/query.py       (working copy)
5@@ -885,9 +885,9 @@
6             group_by = self.group_by or []
7 
8             extra_selects = []
9-            for extra_select, extra_params in self.extra_select.itervalues():
10-                extra_selects.append(extra_select)
11-                params.extend(extra_params)
12+            for extra_select_key in self.extra_select.iterkeys():
13+                extra_selects.append(extra_select_key)
14+
15             for col in group_by + self.related_select_cols + extra_selects:
16                 if isinstance(col, (list, tuple)):
17                     result.append('%s.%s' % (qn(col[0]), qn(col[1])))