Django

Code

Ticket #1616 (closed: duplicate)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: rezzrovv Assigned to: adrian
Milestone: Component: Database wrapper
Version: magic-removal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

query.py.patch1 (1.7 kB) - added by rezzrovv on 04/11/06 08:52:46.
query.py patch

Change History

04/11/06 08:52:46 changed by rezzrovv

  • attachment query.py.patch1 added.

query.py patch

04/11/06 13:19:03 changed 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..

01/24/07 12:44:40 changed by anonymous

  • status changed from new to closed.
  • resolution set to duplicate.

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.

01/24/07 13:00:45 changed by mir@noris.de

oops, last comment was mine.


Add/Change #1616 ([patch] order_by breaks with a table_prefix and column descending.)




Change Properties
Action