Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.6.x] Fixed #21908 -- Added example usage for ModelAdmin.get_inline…

…_instances().

Thanks matt at schinckel.net for the suggestion.

Backport of 5a4f129 from master
  • Loading branch information...
commit e7649789eddeb2ce8f3bf8f69ddc624006d0a46c 1 parent 4aaea29
@timgraham timgraham authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 docs/ref/contrib/admin/index.txt
View
7 docs/ref/contrib/admin/index.txt
@@ -1252,7 +1252,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()
Please sign in to comment.
Something went wrong with that request. Please try again.