summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-03-03 10:40:06 -0500
committerTim Graham <timograham@gmail.com>2014-03-03 10:40:06 -0500
commit5a4f1298cf00fe4e2e35d0a3c02281b4c6afe07c (patch)
tree54d1be0ff3ae3dfcb8ecc7078d554e70e62a52fa /docs/ref
parent0dffaf9c25b9b69f690fc2783c2d528997f9ece8 (diff)
Fixed #21908 -- Added example usage for ModelAdmin.get_inline_instances().
Thanks matt at schinckel.net for the suggestion.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/admin/index.txt7
1 files changed, 6 insertions, 1 deletions
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()