Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#1616 closed defect (duplicate)

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

Reported by: rezzrovv Owned by: Adrian Holovaty
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: no UI/UX: no

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 18 years ago.
query.py patch

Download all attachments as: .zip

Change History (4)

by rezzrovv, 18 years ago

Attachment: query.py.patch1 added

query.py patch

comment:1 by anonymous, 18 years ago

Summary: [magic-removal] order_by breaks with a table_prefix and column descending.[patch] order_by breaks with a table_prefix and column descending.

comment:2 by anonymous, 17 years ago

Resolution: duplicate
Status: newclosed

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 by mir@…, 17 years ago

oops, last comment was mine.

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