summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2018-01-13 01:06:15 +0100
committerTim Graham <timograham@gmail.com>2018-01-12 19:06:15 -0500
commit385e6fb352f3cb80d2f72838e08372cb392aaa45 (patch)
treeef3acfff75e403209d29036e2db9ac215540e92b /django/db/models/sql/query.py
parentb17c1d53fd7875dd0e3ffcffbfdeff348834b9b0 (diff)
Removed Query.split_exclude()'s unused prefix argument.
Unused since b4492a8ca4a7ae4daa3a6b03c3d7a845fad74931.
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 9c97ed772d..b35b42f943 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1186,8 +1186,7 @@ class Query:
# lookup parts
self._lookup_joins = join_info.joins
except MultiJoin as e:
- return self.split_exclude(filter_expr, LOOKUP_SEP.join(parts[:e.level]),
- can_reuse, e.names_with_path)
+ return self.split_exclude(filter_expr, can_reuse, e.names_with_path)
# Update used_joins before trimming since they are reused to determine
# which joins could be later promoted to INNER.
@@ -1524,16 +1523,16 @@ class Query:
col = targets[0].get_col(join_list[-1], join_info.targets[0])
return col
- def split_exclude(self, filter_expr, prefix, can_reuse, names_with_path):
+ def split_exclude(self, filter_expr, can_reuse, names_with_path):
"""
When doing an exclude against any kind of N-to-many relation, we need
to use a subquery. This method constructs the nested query, given the
original exclude filter (filter_expr) and the portion up to the first
N-to-many relation field.
- As an example we could have original filter ~Q(child__name='foo').
- We would get here with filter_expr = child__name, prefix = child and
- can_reuse is a set of joins usable for filters in the original query.
+ For example, if the origin filter is ~Q(child__name='foo'), filter_expr
+ is ('child__name', 'foo') and can_reuse is a set of joins usable for
+ filters in the original query.
We will turn this into equivalent of:
WHERE NOT (pk IN (SELECT parent_id FROM thetable