diff options
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/compiler.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index ace9cf4c88..841ec12f2d 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -493,7 +493,11 @@ class SQLCompiler(object): params.extend(extra_params) cols = (group_by + self.query.select + self.query.related_select_cols + extra_selects) + seen = set() for col in cols: + if col in seen: + continue + seen.add(col) if isinstance(col, (list, tuple)): result.append('%s.%s' % (qn(col[0]), qn(col[1]))) elif hasattr(col, 'as_sql'): |
