diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2011-01-26 03:48:15 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2011-01-26 03:48:15 +0000 |
| commit | 80287f1e8a554290faa6a0c31113a9f4eecf7b79 (patch) | |
| tree | 64fff017ad747c9716f4abf522406159a7ebb3da /django/db/models/sql | |
| parent | 91414c4bb825c65b0ebdcfcbaf39356befdbaf92 (diff) | |
Fixed #13159 -- properly quote aggregates in order_by.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/compiler.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index ba707d4140..d425c8b32b 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -330,7 +330,7 @@ class SQLCompiler(object): continue col, order = get_order_dir(field, asc) if col in self.query.aggregate_select: - result.append('%s %s' % (col, order)) + result.append('%s %s' % (qn(col), order)) continue if '.' in field: # This came in through an extra(order_by=...) addition. Pass it |
