mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #10127 -- Corrected handling of select_related() in annotate() calls. Thanks to Sylvain Pasche <sylvain.pasche@gmail.com> for the report and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -698,7 +698,7 @@ class BaseQuery(object):
|
||||
"""
|
||||
qn = self.quote_name_unless_alias
|
||||
result = []
|
||||
for col in self.group_by:
|
||||
for col in self.group_by + self.related_select_cols:
|
||||
if isinstance(col, (list, tuple)):
|
||||
result.append('%s.%s' % (qn(col[0]), qn(col[1])))
|
||||
elif hasattr(col, 'as_sql'):
|
||||
|
||||
Reference in New Issue
Block a user