diff options
| author | parth <parthvin@gmail.com> | 2019-05-31 01:41:48 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-05-31 13:21:13 +0200 |
| commit | 5c85244eb907974e9bed380df57458640125368a (patch) | |
| tree | 4e236841afacf48ea5e16deb39d813840e8455c2 /docs/ref | |
| parent | 7089502b98f80e8dc1c8f6e85fb0620809aec30e (diff) | |
[2.2.x] Fixed #28831 -- Doc'd that InlineModelAdmin methods' obj argument is the parent object.
Backport of 85436473066aae5d793caeced010ea4f45da4e79 from master
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 4ebe565ae8..b0daeaadaf 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -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` @@ -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) @@ -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 --------------------------------------------------------------------------- |
