Code

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14285 closed (invalid)

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

Reported by: mtsachev 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')

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by mtsachev

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

comment:2 Changed 4 years ago by mtsachev

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.