diff options
Diffstat (limited to 'docs/ref/contrib/admin')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index ac696656c2..6984589ee2 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -213,10 +213,19 @@ subclass:: date_hierarchy = 'pub_date' + You can also specify a field on a related model using the ``__`` lookup, + for example:: + + date_hierarchy = 'author__pub_date' + This will intelligently populate itself based on available data, e.g. if all the dates are in one month, it'll show the day-level drill-down only. + .. versionchanged:: 1.11 + + The ability to reference fields on related models was added. + .. note:: ``date_hierarchy`` uses :meth:`QuerySet.datetimes() |
