mirror of
https://github.com/django/django.git
synced 2025-08-10 05:48:15 +00:00
[1.6.x] Added warning about get_inline_instances() permission checking; refs #23754.
Backport of e0d1f2684a
from master
This commit is contained in:
parent
3c317064d8
commit
c3a40af6ec
1 changed files with 6 additions and 0 deletions
|
@ -1261,9 +1261,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue