mirror of
https://github.com/django/django.git
synced 2025-11-28 22:49:09 +00:00
Fixed #25095 -- Fixed annotate() + values() group by bug
Thanks Josh Smeaton for help on the tests.
This commit is contained in:
parent
199a02d1e2
commit
6024fd5dc2
2 changed files with 33 additions and 2 deletions
|
|
@ -1679,8 +1679,8 @@ class Query(object):
|
|||
for col in self.select:
|
||||
self.group_by.append(col)
|
||||
|
||||
if self._annotations:
|
||||
for alias, annotation in six.iteritems(self.annotations):
|
||||
if self.annotation_select:
|
||||
for alias, annotation in six.iteritems(self.annotation_select):
|
||||
for col in annotation.get_group_by_cols():
|
||||
self.group_by.append(col)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue