diff options
| author | Austin Simmons <autto91@gmail.com> | 2016-09-19 20:29:57 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-27 12:18:52 -0400 |
| commit | 933ebfad06b736e872b4c9afca6697cda8c3e216 (patch) | |
| tree | 55300a9472c39d31d64c2e32294f7fa4f937d1e8 | |
| parent | a9fefd26dc2a8dd2138475635a61e32e014b1e4f (diff) | |
[1.10.x] Fixed #27076 -- Documented contrib.admin.sites.AdminSite.register().
Backport of 0f6829a68afb91abfdea8489008ebffac3d5220c from master
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 097f6622f8..ef333716c7 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2671,6 +2671,18 @@ Templates can override or extend base admin templates as described in :attr:`User.is_staff <django.contrib.auth.models.User.is_staff>` to be ``True``. +.. method:: AdminSite.register(model_or_iterable, admin_class=None, **options) + + Registers the given model class (or iterable of classes) with the given + ``admin_class``. ``admin_class`` defaults to + :class:`~django.contrib.admin.ModelAdmin` (the default admin options). If + keyword arguments are given -- e.g. ``list_display`` -- they'll be applied + as options to the admin class. + + Raises :class:`~django.core.exceptions.ImproperlyConfigured` if a model is + abstract. and ``django.contrib.admin.sites.AlreadyRegistered`` if a model + is already registered. + Hooking ``AdminSite`` instances into your URLconf ------------------------------------------------- |
