diff options
| author | Matthew Schinckel <matt@schinckel.net> | 2017-02-27 19:31:52 +1030 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-08-29 09:45:29 +0200 |
| commit | 4137fc2efce2dde48340728b8006fc6d66b9e3a5 (patch) | |
| tree | df3632a53ff2d1f7efccd501880601f29e06d54c /django/db/backends/base/operations.py | |
| parent | 069bee7c1232458a0f13c2e30daa8df99dbd3680 (diff) | |
Fixed #25367 -- Allowed boolean expressions in QuerySet.filter() and exclude().
This allows using expressions that have an output_field that is a
BooleanField to be used directly in a queryset filters, or in the
When() clauses of a Case() expression.
Thanks Josh Smeaton, Tim Graham, Simon Charette, Mariusz Felisiak, and
Adam Johnson for reviews.
Co-Authored-By: NyanKiyoshi <hello@vanille.bid>
Diffstat (limited to 'django/db/backends/base/operations.py')
| -rw-r--r-- | django/db/backends/base/operations.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py index 76abc6dcb2..a0c84a8ff4 100644 --- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ -581,6 +581,13 @@ class BaseDatabaseOperations: """ pass + def conditional_expression_supported_in_where_clause(self, expression): + """ + Return True, if the conditional expression is supported in the WHERE + clause. + """ + return True + def combine_expression(self, connector, sub_expressions): """ Combine a list of subexpressions into a single expression, using |
