Skip to content

Commit

Permalink
Fixed #8247: Added explanation to admin docs to point out that AdminS…
Browse files Browse the repository at this point in the history
…ite can be subclassed and instantiated like any other Python class

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8732 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
ubernostrum committed Aug 30, 2008
1 parent c0b53b3 commit 3a7fc0c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/ref/contrib/admin.txt
Expand Up @@ -226,7 +226,7 @@ You have four possible values that can be used in ``list_display``:
list_display = (upper_case_name,) list_display = (upper_case_name,)


* A string representing an attribute on the ``ModelAdmin``. This behaves * A string representing an attribute on the ``ModelAdmin``. This behaves
the same as the callable. For example:: same as the callable. For example::


class PersonAdmin(admin.ModelAdmin): class PersonAdmin(admin.ModelAdmin):
list_display = ('upper_case_name',) list_display = ('upper_case_name',)
Expand Down Expand Up @@ -852,6 +852,19 @@ information.
``AdminSite`` objects ``AdminSite`` objects
===================== =====================


A Django administrative site is represented by an instance of
``django.contrib.admin.sites.AdminSite``; by default, an instance of
this class is created as ``django.contrib.admin.site`` and you can
register your models and ``ModelAdmin`` instances with it.

If you'd like to set up your own administrative site with custom
behavior, however, you're free to subclass ``AdminSite`` and override
or add anything you like. Then, simply create an instance of your
``AdminSite`` subclass (the same way you'd instantiate any other
Python class), and register your models and ``ModelAdmin`` subclasses
with it instead of using the default.


Hooking ``AdminSite`` instances into your URLconf Hooking ``AdminSite`` instances into your URLconf
------------------------------------------------- -------------------------------------------------


Expand Down

0 comments on commit 3a7fc0c

Please sign in to comment.