Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14285 closed (invalid)

Calling reverse() on order_by('a', 'b') produces order_by('-a')

Reported by: Martin Tsachev Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords: reverse order_by multiple columns
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If you have order_by for more than one column reverse() will use only the first one to generate the reverse query.

Example:

Calling reverse() on order_by('a', 'b') produces order_by('-a')

Expected:

order_by('-a', '-b')

Change History (2)

comment:1 Changed 6 years ago by Martin Tsachev

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: invalid
Status: newclosed

comment:2 Changed 6 years ago by Martin Tsachev

I used a Manager for order_by() instead of Meta.ordering.

Note: See TracTickets for help on using tickets.
Back to Top