From f683cb90bea2afbe0ef4c011acd4ab590c37410d Mon Sep 17 00:00:00 2001 From: Klemens Mantzos Date: Thu, 23 Jan 2014 03:13:59 +0100 Subject: Fixed #21924 -- Added the ability to specify a reverse order for admin_order_field. Thanks Klemens Mantzos for the report and initial patch. --- docs/ref/contrib/admin/index.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 28de1aa612..e44ecc8e55 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -664,6 +664,14 @@ subclass:: The above will tell Django to order by the ``first_name`` field when trying to sort by ``colored_first_name`` in the admin. + .. versionadded:: 1.7 + + To indicate descending order with ``admin_model_field`` you can use a + hyphen prefix on the field name. Using the above example, this would + look like:: + + colored_first_name.admin_order_field = '-first_name' + * Elements of ``list_display`` can also be properties. Please note however, that due to the way properties work in Python, setting ``short_description`` on a property is only possible when using the -- cgit v1.3