diff options
| author | Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> | 2015-03-30 12:54:25 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-05-11 12:07:36 -0400 |
| commit | bd53db5eab05099ae371348529c6428e0da95c6a (patch) | |
| tree | 3920514c719a6cacc2ba6a8dc7c6d441735bde30 /docs | |
| parent | adc57632bc26cc8fe42bdb6aff463f883214980a (diff) | |
Fixed #24553 -- Added the list of available applications to AdminSite.each_context()
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 21 | ||||
| -rw-r--r-- | docs/releases/1.9.txt | 5 |
2 files changed, 26 insertions, 0 deletions
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 + </ref/applications/>` 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() <django.contrib.admin.AdminSite.each_context>` + method. + :mod:`django.contrib.auth` ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
