diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-09-03 03:48:25 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-09-03 03:48:25 +0000 |
| commit | 61cc4a1eeefe734e258c968293529ab070d4d76a (patch) | |
| tree | a875e609aa60160847077fd8c432eb3542791dc0 /django/db/models/sql/query.py | |
| parent | d2ca6fd54eace38b8ecee8341ad88b1f9284b37f (diff) | |
Fixed #8819 -- Don't include two copies of extra-select columns in the query.
This was triggered by r8794, but was, in fact, fairly fragile before then. The
current fix is the correct way we should be doing this.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index bd723f69d9..ceaf65cd4d 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -630,7 +630,7 @@ class Query(object): else: col, order = get_order_dir(field, asc) elt = qn2(col) - if distinct and elt not in select_aliases: + if distinct and col not in select_aliases: ordering_aliases.append(elt) result.append('%s %s' % (elt, order)) self.ordering_aliases = ordering_aliases |
