diff options
Diffstat (limited to 'django/db/models/fields/related_lookups.py')
| -rw-r--r-- | django/db/models/fields/related_lookups.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py index c20e220141..d745ecd5f9 100644 --- a/django/db/models/fields/related_lookups.py +++ b/django/db/models/fields/related_lookups.py @@ -64,7 +64,9 @@ class RelatedIn(In): # For multicolumn lookups we need to build a multicolumn where clause. # This clause is either a SubqueryConstraint (for values that need to be compiled to # SQL) or an OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses. - from django.db.models.sql.where import WhereNode, SubqueryConstraint, AND, OR + from django.db.models.sql.where import ( + AND, OR, SubqueryConstraint, WhereNode, + ) root_constraint = WhereNode(connector=OR) if self.rhs_is_direct_value(): @@ -120,7 +122,7 @@ class RelatedLookupMixin: if isinstance(self.lhs, MultiColSource): assert self.rhs_is_direct_value() self.rhs = get_normalized_value(self.rhs, self.lhs) - from django.db.models.sql.where import WhereNode, AND + from django.db.models.sql.where import AND, WhereNode root_constraint = WhereNode() for target, source, val in zip(self.lhs.targets, self.lhs.sources, self.rhs): lookup_class = target.get_lookup(self.lookup_name) |
