Opened 11 years ago
Closed 11 years ago
#22926 closed Bug (wontfix)
order_by parameter in extra method override previous order_by fields
| Reported by: | anonymous | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.6 |
| Severity: | Normal | Keywords: | extra, order |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
In this example:
qs = qs.extra(select={'f1': 'some_expression'}, order_by=['f1'])
if some_condition:
qs = qs.extra(select={'f2': 'another_expression'}, order_by=['f2'])
Both f1 and f2 fields are selected but the result is only ordered by f2. I think it is better to append order_by not override it or at least have an option for this.
Note:
See TracTickets
for help on using tickets.
I am going to wontfix this based on following reasons: