From bd53db5eab05099ae371348529c6428e0da95c6a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 30 Mar 2015 12:54:25 +0200 Subject: Fixed #24553 -- Added the list of available applications to AdminSite.each_context() --- docs/ref/contrib/admin/index.txt | 21 +++++++++++++++++++++ docs/releases/1.9.txt | 5 +++++ 2 files changed, 26 insertions(+) (limited to 'docs') diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index e620f34905..ce218f06dc 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2507,11 +2507,32 @@ Templates can override or extend base admin templates as described in * ``site_title``: :attr:`AdminSite.site_title` * ``site_url``: :attr:`AdminSite.site_url` * ``has_permission``: :meth:`AdminSite.has_permission` + * ``available_apps``: a list of applications from the :doc:`application registry + ` available for the current user. Each entry in the + list is a dict representing an application with the following keys: + + * ``app_label``: the application label + * ``app_url``: the URL of the application index in the admin + * ``has_module_perms``: a boolean indicating if displaying and accessing of + the module's index page is permitted for the current user + * ``models``: a list of the models available in the application + + Each model is a dict with the following keys: + + * ``object_name``: class name of the model + * ``name``: plural name of the model + * ``perms``: a ``dict`` tracking ``add``, ``change``, and ``delete`` permissions + * ``admin_url``: admin changelist URL for the model + * ``add_url``: admin URL to add a new model instance .. versionchanged:: 1.8 The ``request`` argument and the ``has_permission`` variable were added. + .. versionchanged:: 1.9 + + The ``available_apps`` variable was added. + .. method:: AdminSite.has_permission(request) Returns ``True`` if the user for the given ``HttpRequest`` has permission diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index 99daac6a8f..8be0e334b8 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -48,6 +48,11 @@ Minor features changing the ``select_related()`` values used in the admin's changelist query based on the request. +* The ``available_apps`` context variable, which lists the available + applications for the current user, has been added to the + :meth:`AdminSite.each_context() ` + method. + :mod:`django.contrib.auth` ^^^^^^^^^^^^^^^^^^^^^^^^^^ -- cgit v1.3