diff options
author | Nick Pope <nick@nickpope.me.uk> | 2022-07-23 13:31:35 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-07-27 07:55:09 +0200 |
commit | 769d7cce4aedfcbba59f1b68577225d07701c206 (patch) | |
tree | c896675140b6d356bf35db97df06b9d83dad67f5 /django/db/models/sql/query.py | |
parent | e20e5d1557785ba71e8ef0ceb8ccb85bdc13840a (diff) | |
download | django-769d7cce4aedfcbba59f1b68577225d07701c206.tar.gz |
Used AND, OR, XOR constants instead of hard-coded values.
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r-- | django/db/models/sql/query.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index cf7566d771..14ed0c0a63 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -2658,7 +2658,7 @@ class JoinPromoter: # to rel_a would remove a valid match from the query. So, we need # to promote any existing INNER to LOUTER (it is possible this # promotion in turn will be demoted later on). - if self.effective_connector == "OR" and votes < self.num_children: + if self.effective_connector == OR and votes < self.num_children: to_promote.add(table) # If connector is AND and there is a filter that can match only # when there is a joinable row, then use INNER. For example, in @@ -2670,8 +2670,8 @@ class JoinPromoter: # (rel_a__col__icontains=Alex | rel_a__col__icontains=Russell) # then if rel_a doesn't produce any rows, the whole condition # can't match. Hence we can safely use INNER join. - if self.effective_connector == "AND" or ( - self.effective_connector == "OR" and votes == self.num_children + if self.effective_connector == AND or ( + self.effective_connector == OR and votes == self.num_children ): to_demote.add(table) # Finally, what happens in cases where we have: |