Fixed #34303 –- Allowed customizing admin site log entry list.

Added AdminSite.get_log_entries() as an override point and made this
available to the template via each_context().
This commit is contained in:
Jacob Rief 2023-02-08 18:37:32 +01:00 committed by GitHub
parent 1964e4367f
commit 473283d241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 76 additions and 13 deletions

View file

@ -2832,6 +2832,7 @@ Templates can override or extend base admin templates as described in
* ``is_popup``: whether the current page is displayed in a popup window
* ``is_nav_sidebar_enabled``: :attr:`AdminSite.enable_nav_sidebar`
* ``log_entries``: :meth:`.AdminSite.get_log_entries`
.. method:: AdminSite.get_app_list(request, app_label=None)
@ -2889,6 +2890,15 @@ Templates can override or extend base admin templates as described in
Raises ``django.contrib.admin.sites.NotRegistered`` if a model isn't
already registered.
.. method:: AdminSite.get_log_entries(request)
.. versionadded:: 5.0
Returns a queryset for the related
:class:`~django.contrib.admin.models.LogEntry` instances, shown on the site
index page. This method can be overridden to filter the log entries by
other criteria.
.. _hooking-adminsite-to-urlconf:
Hooking ``AdminSite`` instances into your URLconf