Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1616 closed defect (duplicate)

[patch] order_by breaks with a table_prefix and column descending.

Reported by: rezzrovv Owned by: adrian
Component: Database layer (models, ORM) Version: magic-removal
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If using a table and column from extra()
(i.e. {'select':{'media':'select media from product where ... }})
in order_by(product.-media?) and the intended column is to be sorted in descending order, the query_set breaks as ascending/descending is tested prior to determining whether a table_prefix exists.

Attachments (1)

query.py.patch1 (1.7 KB) - added by rezzrovv 9 years ago.
query.py patch

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by rezzrovv

query.py patch

comment:1 Changed 9 years ago by anonymous

  • Summary changed from [magic-removal] order_by breaks with a table_prefix and column descending. to [patch] order_by breaks with a table_prefix and column descending.

comment:2 Changed 9 years ago by anonymous

  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #2210

the syntax order_by('table.column') was only a hack, correct usage is order_by('foreign_key_field__column'). #2210 has a working patch for it.

comment:3 Changed 9 years ago by mir@…

oops, last comment was mine.

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