summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index f868347960..629afa29e7 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -389,7 +389,7 @@ class BaseQuery(object):
# other than MySQL), then any fields mentioned in the
# ordering clause needs to be in the group by clause.
if not self.connection.features.allows_group_by_pk:
- grouping.extend([col for col in ordering_group_by
+ grouping.extend([str(col) for col in ordering_group_by
if col not in grouping])
else:
ordering = self.connection.ops.force_no_ordering()