Removed Query.split_exclude()'s unused prefix argument.

Unused since b4492a8ca4.
This commit is contained in:
Mariusz Felisiak 2018-01-13 01:06:15 +01:00 committed by Tim Graham
parent b17c1d53fd
commit 385e6fb352
1 changed files with 5 additions and 6 deletions

View File

@ -1186,8 +1186,7 @@ class Query:
# lookup parts # lookup parts
self._lookup_joins = join_info.joins self._lookup_joins = join_info.joins
except MultiJoin as e: except MultiJoin as e:
return self.split_exclude(filter_expr, LOOKUP_SEP.join(parts[:e.level]), return self.split_exclude(filter_expr, can_reuse, e.names_with_path)
can_reuse, e.names_with_path)
# Update used_joins before trimming since they are reused to determine # Update used_joins before trimming since they are reused to determine
# which joins could be later promoted to INNER. # 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]) col = targets[0].get_col(join_list[-1], join_info.targets[0])
return col 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 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 to use a subquery. This method constructs the nested query, given the
original exclude filter (filter_expr) and the portion up to the first original exclude filter (filter_expr) and the portion up to the first
N-to-many relation field. N-to-many relation field.
As an example we could have original filter ~Q(child__name='foo'). For example, if the origin filter is ~Q(child__name='foo'), filter_expr
We would get here with filter_expr = child__name, prefix = child and is ('child__name', 'foo') and can_reuse is a set of joins usable for
can_reuse is a set of joins usable for filters in the original query. filters in the original query.
We will turn this into equivalent of: We will turn this into equivalent of:
WHERE NOT (pk IN (SELECT parent_id FROM thetable WHERE NOT (pk IN (SELECT parent_id FROM thetable