From 5a4f1298cf00fe4e2e35d0a3c02281b4c6afe07c Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 3 Mar 2014 10:40:06 -0500 Subject: [PATCH] Fixed #21908 -- Added example usage for ModelAdmin.get_inline_instances(). Thanks matt at schinckel.net for the suggestion. --- docs/ref/contrib/admin/index.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index f2fdd39714..e160926f48 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1393,7 +1393,12 @@ templates used by the :class:`ModelAdmin` views: ``obj`` being edited (or ``None`` on an add form) and is expected to return a ``list`` or ``tuple`` of :class:`~django.contrib.admin.InlineModelAdmin` objects, as described below in the :class:`~django.contrib.admin.InlineModelAdmin` - section. + section. For example, the following would return inlines without the default + filtering based on add, change, and delete permissions:: + + class MyModelAdmin(admin.ModelAdmin): + def get_inline_instances(request, obj=None): + return [inline(self.model, self.admin_site) for inline in self.inlines] .. method:: ModelAdmin.get_urls()