Opened 6 years ago
Closed 6 years ago
#30532 closed Cleanup/optimization (duplicate)
Union queryset should raise on filter() and exclude().
Reported by: | Charles Thayer | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If a queryset results from a union() it would help to have filter() and exclude() raise instead of return unpredictable results. I propose a _is_union_result bool flag on querysets to track this.
/charles thayer
Change History (1)
comment:1 by , 6 years ago
Component: | Uncategorized → Database layer (models, ORM) |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | Feature request: union queryset should raise on filter → Union queryset should raise on filter() and exclude(). |
Type: | Uncategorized → Cleanup/optimization |
Version: | 2.2 → master |
Note:
See TracTickets
for help on using tickets.
Yes
filter()
andexclude()
are unsupported but doesn't raise an error yet. As per the documentation, "only LIMIT, OFFSET, COUNT(*), ORDER BY, and specifying columns (i.e. slicing, count(), order_by(), and values()/values_list()) are allowed on the resulting QuerySet.".Duplicate of #27995.
See also a ticket #28519 to support these features.