Skip to content

Commit

Permalink
[2.2.x] Fixed #28831 -- Doc'd that InlineModelAdmin methods' obj argu…
Browse files Browse the repository at this point in the history
…ment is the parent object.

Backport of 8543647 from master
  • Loading branch information
Parth1811 authored and felixxm committed May 31, 2019
1 parent 7089502 commit 5c85244
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/ref/contrib/admin/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,7 @@ adds some of its own (the shared features are actually defined in the
- :attr:`~ModelAdmin.filter_vertical`
- :attr:`~ModelAdmin.ordering`
- :attr:`~ModelAdmin.prepopulated_fields`
- :meth:`~ModelAdmin.get_fieldsets`
- :meth:`~ModelAdmin.get_queryset`
- :attr:`~ModelAdmin.radio_fields`
- :attr:`~ModelAdmin.readonly_fields`
Expand Down Expand Up @@ -2368,7 +2369,8 @@ The ``InlineModelAdmin`` class adds or customizes:
.. method:: InlineModelAdmin.get_formset(request, obj=None, **kwargs)

Returns a :class:`~django.forms.models.BaseInlineFormSet` class for use in
admin add/change views. See the example for
admin add/change views. ``obj`` is the parent object being edited or
``None`` when adding a new parent. See the example for
:class:`ModelAdmin.get_formsets_with_inlines`.

.. method:: InlineModelAdmin.get_extra(request, obj=None, **kwargs)
Expand Down Expand Up @@ -2438,6 +2440,10 @@ The ``InlineModelAdmin`` class adds or customizes:
Should return ``True`` if deleting an inline object is permitted, ``False``
otherwise. ``obj`` is the parent object being edited.

.. note::
The ``obj`` argument passed to ``InlineModelAdmin`` methods is the parent
object being edited or ``None`` when adding a new parent.

Working with a model with two or more foreign keys to the same parent model
---------------------------------------------------------------------------

Expand Down

0 comments on commit 5c85244

Please sign in to comment.