mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Changed Query.get_columns() to quote the 'AS' column names in an extra_select situation, to match pre-queryset-refactor behavior. Added unit tests that verify this and provide an example
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -394,7 +394,8 @@ class Query(object):
|
||||
some cases to avoid ambiguitity with nested queries.
|
||||
"""
|
||||
qn = self.quote_name_unless_alias
|
||||
result = ['(%s) AS %s' % (col, alias) for alias, col in self.extra_select.iteritems()]
|
||||
qn2 = self.connection.ops.quote_name
|
||||
result = ['(%s) AS %s' % (col, qn2(alias)) for alias, col in self.extra_select.iteritems()]
|
||||
aliases = set(self.extra_select.keys())
|
||||
if with_aliases:
|
||||
col_aliases = aliases.copy()
|
||||
|
||||
Reference in New Issue
Block a user