summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-04-01 16:48:16 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-04-01 16:48:16 +0000
commitf7cf58ac0ebf720e5c48f00e99c31cf39c4fca50 (patch)
tree048de60757bde88fb24d035508559d78b851884d /django/db/models/sql/query.py
parentc39ec6dccb389fbb4047e44f5247e18bb76ae598 (diff)
Fixed #12429 -- Ensure that raw queries call resolve_columns if the backend defines it. This ensures (as much as possible) that the model values returned by a raw query match that in normal queries. Thanks to Ian Kelly for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12904 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 9819be09a1..72d4bc9c1b 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -189,6 +189,11 @@ class Query(object):
raise ValueError("Need either using or connection")
if using:
connection = connections[using]
+
+ # Check that the compiler will be able to execute the query
+ for alias, aggregate in self.aggregate_select.items():
+ connection.ops.check_aggregate_support(aggregate)
+
return connection.ops.compiler(self.compiler)(self, connection, using)
def get_meta(self):