Django

Code

Ticket #3742 (closed: duplicate)

Opened 3 years ago

Last modified 3 years ago

Function with `admin_order_field` only sorts in one direction, with no arrows

Reported by: Jeff Wheeler <jeff@nokrev.com> Assigned to: nobody
Milestone: Component: django.contrib.admin
Version: 0.96 Keywords: admin admin_order_field
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When using admin_order_field on a function, it can only be sorted in one direction (ascending), and no arrows will be displayed when sorted.

my_function.admin_order_field = 'model_field'

This will result in the column showing up correctly, and it is a link which sorts, but it does not work, as described above.

Attachments

admin_order_fields_desc.diff (0.6 kB) - added by matt <matt.barry@dotwell.org> on 03/28/07 09:53:13.
Bidirectional change list sorting for sortable non-fields

Change History

03/28/07 09:53:13 changed by matt <matt.barry@dotwell.org>

  • attachment admin_order_fields_desc.diff added.

Bidirectional change list sorting for sortable non-fields

03/28/07 09:55:27 changed by matt <matt.barry@dotwell.org>

  • needs_better_patch changed.
  • has_patch set to 1.
  • needs_tests changed.
  • needs_docs changed.

Added a patch which I think fixes the problem, which is basically that the last case is comparing field_name to the current sort field; for sortable non-fields it will be admin_order_field and not field_name.

06/16/07 13:31:22 changed by renata_zan@hotmail.com

  • version changed from SVN to 0.96.

tetst

09/16/07 13:34:09 changed by ubernostrum

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

Is this still an issue? #3397 seems to have been re-opened and fixed multiple times to resolve issues with admin_order_field, so I'm going to close out as a duplicate. Re-open #3397 if you're still seeing problems (though at this point I don't think we'll be doing too much to the deprecated admin app).


Add/Change #3742 (Function with `admin_order_field` only sorts in one direction, with no arrows)




Change Properties
Action