Opened 6 months ago

Last modified 6 months ago

#28333 new New feature

Filter and subquery for window expressions

Reported by: Mads Jensen Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords: window orm filter subquery
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Mads Jensen)

#26608 will introduce window function expressions, but will disallow filtering on the result of them, e.g.:

Window.objects.annotate(row=Window(expression=RowNumber())).filter(row__gt=1)

is not allowed. Instead, the window function expression should be wrapped in an inner query, and the filtering should be done in an outer query.

Change History (1)

comment:1 Changed 6 months ago by Mads Jensen

Description: modified (diff)
Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top