Change History (7)

Admin: In multi-column ordering, only the first column is used. →
Admin doc does not reflect the fact that In multi-column ordering, only the first column is used.

Looking at the ChangeList.get_ordering() function, it is clear that the admin is ignoring the other columns by design.

This is really a documentation problem, and I am changing the ticket to reflect that.

The admin.txt document states:

``ordering``
~~~~~~~~~~~~
Set ``ordering`` to specify how objects on the admin change list page should be
ordered. This should be a list or tuple in the same format as a model's
``ordering`` parameter.
If this isn't provided, the Django admin will use the model's default ordering.

Obviously, there should be a note here stating that only the first column is used, and all others are ignored.

It is correct that ChangeList only works with one field. There is another ticket open for that. One day it will support more than one. It will be a big change since it will involve UI changes as well. Marking as accepted for the docs change.

(In [8210]) Fixed #7942 -- Added a note to the admin ordering option documentation about the admin only respecting the first element. Thanks mwdiers for the report and MattBowen for the original patch.