mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #25095 -- Fixed annotate() + values() group by bug
Thanks Josh Smeaton for help on the tests.
This commit is contained in:
committed by
Tim Graham
parent
199a02d1e2
commit
6024fd5dc2
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user