Fixed #27076 -- Documented contrib.admin.sites.AdminSite.register().

This commit is contained in:
Austin Simmons 2016-09-19 20:29:57 -07:00 committed by Tim Graham
parent 617e36dc1e
commit 0f6829a68a
1 changed files with 12 additions and 0 deletions

View File

@ -2658,6 +2658,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
-------------------------------------------------