From 933ebfad06b736e872b4c9afca6697cda8c3e216 Mon Sep 17 00:00:00 2001 From: Austin Simmons Date: Mon, 19 Sep 2016 20:29:57 -0700 Subject: [PATCH] [1.10.x] Fixed #27076 -- Documented contrib.admin.sites.AdminSite.register(). Backport of 0f6829a68afb91abfdea8489008ebffac3d5220c from master --- docs/ref/contrib/admin/index.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 ` 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 -------------------------------------------------