From 4e5c20b78b17df25948809ca1c880551351d4d83 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 31 Mar 2010 13:43:22 +0000 Subject: 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 --- django/db/models/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/models/sql/compiler.py') 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, -- cgit v1.3