summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2014-11-25 13:13:45 -0500
committerTim Graham <timograham@gmail.com>2014-11-25 13:15:02 -0500
commitf46ebc680b4868d61aec629ceded380ef313a687 (patch)
tree85e760c3e1a13cbc2d570ee987ddd261ab08754f /docs/ref
parentf671905fdb678eb9fc3763d94bfe560b2d9d0b40 (diff)
[1.7.x] Added warning about get_inline_instances() permission checking; refs #23754.
Backport of e0d1f2684ae60573b209783f9fd4f9db163ad704 from master
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/admin/index.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 195d11cb98..e25557a5b3 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -1402,9 +1402,15 @@ templates used by the :class:`ModelAdmin` views:
filtering based on add, change, and delete permissions::
class MyModelAdmin(admin.ModelAdmin):
+ inlines = (MyInline,)
+
def get_inline_instances(self, request, obj=None):
return [inline(self.model, self.admin_site) for inline in self.inlines]
+ If you override this method, make sure that the returned inlines are
+ instances of the classes defined in :attr:`inlines` or you might encounter
+ a "Bad Request" error when adding related objects.
+
.. method:: ModelAdmin.get_urls()
The ``get_urls`` method on a ``ModelAdmin`` returns the URLs to be used for