summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2014-06-15 10:16:33 +0100
committerMarc Tamlyn <marc.tamlyn@gmail.com>2014-06-15 10:16:33 +0100
commitdd57b89fcb8f009fc73f16efea9539e5888eb59d (patch)
tree478ef60d0bdacdb1e0bf0c74e8f337110bd2997c /django/db/models/sql/compiler.py
parentc281831a5cb20a31cb080ff7b4af4bcfc83fcf3d (diff)
parentd2cbcbcc76a0718d45ca2305c8a55b86eb4c58c1 (diff)
Merge pull request #2806 from jorgecarleitao/issue22826
Fixed #22826 -- Improved internal usage of Query.setup_joins.
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r--django/db/models/sql/compiler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 6792824ecd..59b31dcb79 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -96,7 +96,7 @@ class SQLCompiler(object):
# However we do not want to get rid of stuff done in pre_sql_setup(),
# as the pre_sql_setup will modify query state in a way that forbids
# another run of it.
- self.refcounts_before = self.query.alias_refcount.copy()
+ refcounts_before = self.query.alias_refcount.copy()
out_cols, s_params = self.get_columns(with_col_aliases)
ordering, o_params, ordering_group_by = self.get_ordering()
@@ -169,7 +169,7 @@ class SQLCompiler(object):
result.append(self.connection.ops.for_update_sql(nowait=nowait))
# Finally do cleanup - get rid of the joins we created above.
- self.query.reset_refcounts(self.refcounts_before)
+ self.query.reset_refcounts(refcounts_before)
return ' '.join(result), tuple(params)
@@ -546,7 +546,7 @@ class SQLCompiler(object):
result.append('%s%s%s' % (connector, qn(name), alias_str))
first = False
for t in self.query.extra_tables:
- alias, unused = self.query.table_alias(t)
+ alias, _ = self.query.table_alias(t)
# Only add the alias if it's not already present (the table_alias()
# calls increments the refcount, so an alias refcount of one means
# this is the only reference.