From e0d1f2684ae60573b209783f9fd4f9db163ad704 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Tue, 25 Nov 2014 13:13:45 -0500 Subject: [PATCH] Added warning about get_inline_instances() permission checking; refs #23754. --- docs/ref/contrib/admin/index.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 4c06a7575ea..a85993cd2e6 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1415,9 +1415,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