mirror of
https://github.com/django/django.git
synced 2025-08-08 12:58:37 +00:00
Fixed #24705 -- Fixed negated Q objects in expressions.
Avoided split_exclude() for Q when used as an expression.
This commit is contained in:
parent
8b106cfaa0
commit
bc87061a3c
4 changed files with 54 additions and 6 deletions
|
@ -90,7 +90,7 @@ class Q(tree.Node):
|
|||
# We must promote any new joins to left outer joins so that when Q is
|
||||
# used as an expression, rows aren't filtered due to joins.
|
||||
joins_before = query.tables[:]
|
||||
clause, joins = query._add_q(self, reuse, allow_joins=allow_joins)
|
||||
clause, joins = query._add_q(self, reuse, allow_joins=allow_joins, split_subq=False)
|
||||
joins_to_promote = [j for j in joins if j not in joins_before]
|
||||
query.promote_joins(joins_to_promote)
|
||||
return clause
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue