mirror of
https://github.com/django/django.git
synced 2025-08-22 03:24:21 +00:00
Fixed #27021 -- Allowed lookup expressions in annotations, aggregations, and QuerySet.filter().
Thanks Hannes Ljungberg and Simon Charette for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
parent
f5dccbafb9
commit
f42ccdd835
11 changed files with 268 additions and 48 deletions
|
@ -1248,9 +1248,9 @@ class OrderBy(Expression):
|
|||
return (template % placeholders).rstrip(), params
|
||||
|
||||
def as_oracle(self, compiler, connection):
|
||||
# Oracle doesn't allow ORDER BY EXISTS() unless it's wrapped in
|
||||
# a CASE WHEN.
|
||||
if isinstance(self.expression, Exists):
|
||||
# Oracle doesn't allow ORDER BY EXISTS() or filters unless it's wrapped
|
||||
# in a CASE WHEN.
|
||||
if connection.ops.conditional_expression_supported_in_where_clause(self.expression):
|
||||
copy = self.copy()
|
||||
copy.expression = Case(
|
||||
When(self.expression, then=True),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue