summaryrefslogtreecommitdiff
path: root/django/db/models
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-03-31 13:43:22 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-03-31 13:43:22 +0000
commit4e5c20b78b17df25948809ca1c880551351d4d83 (patch)
tree052c37704c5940c20f224054cfca245c7d788d34 /django/db/models
parenta75dc3406f63ec621f2bc3f9af79152c0df92182 (diff)
Fixed #11916 -- Corrected handling of aggregation when there is a subquery provided in an extra(select=) clause. Thanks to jaklaassen@gmail.com for the report, and to tobias, paluh, Karen Tracey and Ian Kelly for their work on the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12896 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models')
-rw-r--r--django/db/models/sql/compiler.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 2fe03302a9..a07e506fc7 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -484,7 +484,7 @@ class SQLCompiler(object):
elif hasattr(col, 'as_sql'):
result.append(col.as_sql(qn))
else:
- result.append(str(col))
+ result.append('(%s)' % str(col))
return result, params
def fill_related_selections(self, opts=None, root_alias=None, cur_depth=1,