diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 8 | ||||
| -rw-r--r-- | docs/releases/1.7.txt | 4 |
2 files changed, 12 insertions, 0 deletions
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 diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index d2f1c39ec3..8e9ebe72a1 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -292,6 +292,10 @@ Minor features <django.contrib.admin.ModelAdmin.view_on_site>` to control whether or not to display the "View on site" link. +* You can specify a descending ordering for a :attr:`ModelAdmin.list_display + <django.contrib.admin.ModelAdmin.list_display>` value by prefixing the + ``admin_order_field`` value with a hyphen. + :mod:`django.contrib.auth` ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
