mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts: docs/ref/django-admin.txt
This commit is contained in:
@@ -600,7 +600,7 @@ for your own sanity when dealing with the interactive prompt, but also because
|
||||
objects' representations are used throughout Django's automatically-generated
|
||||
admin.
|
||||
|
||||
.. admonition:: `__unicode__` or `__str__`?
|
||||
.. admonition:: ``__unicode__`` or ``__str__``?
|
||||
|
||||
On Python 3, things are simpler, just use
|
||||
:meth:`~django.db.models.Model.__str__` and forget about
|
||||
|
||||
@@ -385,15 +385,6 @@ search terms, Django will search the ``question`` field. You can use as many
|
||||
fields as you'd like -- although because it uses a ``LIKE`` query behind the
|
||||
scenes, keep it reasonable, to keep your database happy.
|
||||
|
||||
Finally, because ``Poll`` objects have dates, it'd be convenient to be able to
|
||||
drill down by date. Add this line::
|
||||
|
||||
date_hierarchy = 'pub_date'
|
||||
|
||||
That adds hierarchical navigation, by date, to the top of the change list page.
|
||||
At top level, it displays all available years. Then it drills down to months
|
||||
and, ultimately, days.
|
||||
|
||||
Now's also a good time to note that change lists give you free pagination. The
|
||||
default is to display 100 items per page. Change-list pagination, search boxes,
|
||||
filters, date-hierarchies and column-header-ordering all work together like you
|
||||
|
||||
Reference in New Issue
Block a user