summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>2015-03-30 12:54:25 +0200
committerTim Graham <timograham@gmail.com>2015-05-11 12:07:36 -0400
commitbd53db5eab05099ae371348529c6428e0da95c6a (patch)
tree3920514c719a6cacc2ba6a8dc7c6d441735bde30 /docs/ref
parentadc57632bc26cc8fe42bdb6aff463f883214980a (diff)
Fixed #24553 -- Added the list of available applications to AdminSite.each_context()
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/admin/index.txt21
1 files changed, 21 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