summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-11-06 21:32:29 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2013-11-07 12:57:02 +0200
commitccbba98131ace3beb43790c65e8f4eee94e9631c (patch)
treedacfc0f72f35b101133b0640af8c2a419247ea58 /django/db/models/sql/compiler.py
parentba6c9fae452d3e4260ed0c1c74230da74f74f665 (diff)
Removed non-necessary code in Compiler._setup_joins()
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r--django/db/models/sql/compiler.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 4244e3d854..230a8e19a2 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -452,8 +452,7 @@ class SQLCompiler(object):
def _setup_joins(self, pieces, opts, alias):
"""
- A helper method for get_ordering and get_distinct. This method will
- call query.setup_joins and handle refcounts.
+ A helper method for get_ordering and get_distinct.
Note that get_ordering and get_distinct must produce same target
columns on same input, as the prefixes of get_ordering and get_distinct
@@ -464,11 +463,6 @@ class SQLCompiler(object):
field, targets, opts, joins, path = self.query.setup_joins(
pieces, opts, alias)
alias = joins[-1]
- if not field.rel:
- # To avoid inadvertent trimming of a necessary alias, use the
- # refcount to show that we are referencing a non-relation field on
- # the model.
- self.query.ref_alias(alias)
return field, targets, alias, joins, path, opts
def get_from_clause(self):