Opened 10 years ago
Closed 10 years ago
#24923 closed Cleanup/optimization (fixed)
Aggregates in order_by should error out nicely
| Reported by: | Anssi Kääriäinen | Owned by: | |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Expressions are allowed in order_by, but aggregates don't currently work. Making them work would cause too much trouble when taking in account that you can already do
qs.annotate(agg=Sum('foo')).order_by('agg')
as opposed to
qs.order_by(Sum('foo'))
Change History (5)
comment:1 by , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 10 years ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
comment:3 by , 10 years ago
| Patch needs improvement: | set |
|---|---|
| Version: | 1.8 → master |
Left notes on the PR.
comment:4 by , 10 years ago
| Patch needs improvement: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
I've fixed all review issues.
Note:
See TracTickets
for help on using tickets.
akaariai: what would you suggest as the error message or behaviour?