mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #27991 -- Added obj arg to InlineModelAdmin.has_add_permission().
Thanks Vladimir Ivanov for the initial patch.
This commit is contained in:
parent
4f88143649
commit
be6ca89396
7 changed files with 128 additions and 6 deletions
|
@ -2395,10 +2395,15 @@ The ``InlineModelAdmin`` class adds or customizes:
|
|||
inline forms. For example, this may be based on the model instance
|
||||
(passed as the keyword argument ``obj``).
|
||||
|
||||
.. method:: InlineModelAdmin.has_add_permission(request)
|
||||
.. method:: InlineModelAdmin.has_add_permission(request, obj)
|
||||
|
||||
Should return ``True`` if adding an inline object is permitted, ``False``
|
||||
otherwise.
|
||||
otherwise. ``obj`` is the parent object being edited or ``None`` when
|
||||
adding a new parent.
|
||||
|
||||
.. versionchanged:: 2.1
|
||||
|
||||
The ``obj`` argument was added.
|
||||
|
||||
.. method:: InlineModelAdmin.has_change_permission(request, obj=None)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue