1
0
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:
Mitchell Kotler
2015-07-15 17:29:33 -04:00
committed by Tim Graham
parent 199a02d1e2
commit 6024fd5dc2
2 changed files with 33 additions and 2 deletions

View File

@@ -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)