summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorVytis Banaitis <vytis.banaitis@gmail.com>2016-05-05 20:52:54 +0300
committerTim Graham <timograham@gmail.com>2016-06-04 12:14:02 -0400
commit2f9c4e2b6fab3ce08cfbebff79d758196250790c (patch)
tree550e125782fed8aed39589882c426b9178f78d4e /docs
parent89ca1128840a2ae011109cbf38ea5ee9549f1533 (diff)
Fixed #19963 -- Added support for date_hierarchy across relations.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/checks.txt2
-rw-r--r--docs/ref/contrib/admin/index.txt9
-rw-r--r--docs/releases/1.11.txt2
3 files changed, 11 insertions, 2 deletions
diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt
index 03bdba97db..ac96fbf412 100644
--- a/docs/ref/checks.txt
+++ b/docs/ref/checks.txt
@@ -393,7 +393,7 @@ with the admin site:
which is not editable through the admin.
* **admin.E126**: The value of ``search_fields`` must be a list or tuple.
* **admin.E127**: The value of ``date_hierarchy`` refers to ``<field name>``,
- which is not an attribute of ``<model>``.
+ which does not refer to a Field.
* **admin.E128**: The value of ``date_hierarchy`` must be a ``DateField`` or
``DateTimeField``.
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()
diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt
index ae3f3af438..918a6157f1 100644
--- a/docs/releases/1.11.txt
+++ b/docs/releases/1.11.txt
@@ -50,7 +50,7 @@ Minor features
:mod:`django.contrib.admin`
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* ...
+* :attr:`.ModelAdmin.date_hierarchy` can now reference fields across relations.
:mod:`django.contrib.admindocs`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~