From 4cf1327aa4bc765ba3ed9df32f48bef5e936ebef Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Tue, 24 Feb 2009 01:10:26 +0000 Subject: [PATCH] Cleaned up some documentation about admin URLs in Django 1.1. Thanks, Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9892 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/intro/tutorial02.txt | 3 +++ docs/ref/contrib/admin.txt | 22 ++++++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index fb6794b46c..0d62c56a7b 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -40,6 +40,9 @@ activate the admin site for your installation, do these three things: know is that it maps URL roots to applications. In the end, you should have a ``urls.py`` file that looks like this: + .. versionchanged:: 1.1 + The method for adding admin urls has changed in Django 1.1. + .. parsed-literal:: from django.conf.urls.defaults import * diff --git a/docs/ref/contrib/admin.txt b/docs/ref/contrib/admin.txt index 266ed95133..35bfde217c 100644 --- a/docs/ref/contrib/admin.txt +++ b/docs/ref/contrib/admin.txt @@ -676,6 +676,8 @@ model instance:: ``get_urls(self)`` ~~~~~~~~~~~~~~~~~~~ +.. versionadded:: 1.1 + The ``get_urls`` method on a ``ModelAdmin`` returns the URLs to be used for that ModelAdmin in the same way as a URLconf. Therefore you can extend them as documented in :ref:`topics-http-urls`:: @@ -1157,6 +1159,10 @@ It's easy to create multiple instances of the admin site on the same Django-powered Web site. Just create multiple instances of ``AdminSite`` and root each one at a different URL. +.. versionchanged:: 1.1 + The method for hooking ``AdminSite`` instances into urls has changed in + Django 1.1. + In this example, the URLs ``/basic-admin/`` and ``/advanced-admin/`` feature separate versions of the admin site -- using the ``AdminSite`` instances ``myproject.admin.basic_site`` and ``myproject.admin.advanced_site``, @@ -1174,22 +1180,10 @@ respectively:: Adding views to admin sites --------------------------- +.. versionadded:: 1.1 + It possible to add additional views to the admin site in the same way one can add them to ``ModelAdmins``. This by using the ``get_urls()`` method on an AdminSite in the same way as `described above`__ __ `get_urls(self)`_ - -Protecting Custom ``AdminSite`` and ``ModelAdmin`` --------------------------------------------------- - -By default all the views in the Django admin are protected so that only staff -members can access them. If you add your own views to either a ``ModelAdmin`` -or ``AdminSite`` you should ensure that where necessary they are protected in -the same manner. To do this use the ``admin_perm_test`` decorator provided in -``django.contrib.admin.utils.admin_perm_test``. It can be used in the same way -as the ``login_required`` decorator. - -.. note:: - The ``admin_perm_test`` decorator can only be used on methods which are on - ``ModelAdmins`` or ``AdminSites``, you cannot use it on arbitrary functions.