Ticket #11916: django.db.models.sql.query.patch

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

changing grouping generation from values to keys of extra selects

  • django/db/models/sql/query.py

     
    885885            group_by = self.group_by or []
    886886
    887887            extra_selects = []
    888             for extra_select, extra_params in self.extra_select.itervalues():
    889                 extra_selects.append(extra_select)
    890                 params.extend(extra_params)
     888            for extra_select_key in self.extra_select.iterkeys():
     889                extra_selects.append(extra_select_key)
     890
    891891            for col in group_by + self.related_select_cols + extra_selects:
    892892                if isinstance(col, (list, tuple)):
    893893                    result.append('%s.%s' % (qn(col[0]), qn(col[1])))
Back to Top