admin.InlineModelAdmin.get_formset()

InlineModelAdmin.get_formset(request, obj=None, **kwargs) Returns a BaseInlineFormSet class for use in admin add/change views. See the example for ModelAdmin.get_formsets_with_inlines.

admin.InlineModelAdmin.get_extra()

InlineModelAdmin.get_extra(request, obj=None, **kwargs) Returns the number of extra inline forms to use. By default, returns the InlineModelAdmin.extra attribute. Override this method to programmatically determine the number of extra inline forms. For example, this may be based on the model instance (passed as the keyword argument obj): class BinaryTreeAdmin(admin.TabularInline): model = BinaryTree def get_extra(self, request, obj=None, **kwargs): extra = 2 if obj:

admin.InlineModelAdmin.formset

InlineModelAdmin.formset This defaults to BaseInlineFormSet. Using your own formset can give you many possibilities of customization. Inlines are built around model formsets.

admin.InlineModelAdmin.form

InlineModelAdmin.form The value for form defaults to ModelForm. This is what is passed through to inlineformset_factory() when creating the formset for this inline. Warning When writing custom validation for InlineModelAdmin forms, be cautious of writing validation that relies on features of the parent model. If the parent model fails to validate, it may be left in an inconsistent state as described in the warning in Validation on a ModelForm.

admin.InlineModelAdmin.fk_name

InlineModelAdmin.fk_name The name of the foreign key on the model. In most cases this will be dealt with automatically, but fk_name must be specified explicitly if there are more than one foreign key to the same parent model.

admin.InlineModelAdmin.extra

InlineModelAdmin.extra This controls the number of extra forms the formset will display in addition to the initial forms. See the formsets documentation for more information. For users with JavaScript-enabled browsers, an “Add another” link is provided to enable any number of additional inlines to be added in addition to those provided as a result of the extra argument. The dynamic link will not appear if the number of currently displayed forms exceeds max_num, or if the user does not have J

admin.InlineModelAdmin.classes

InlineModelAdmin.classes New in Django 1.10. A list or tuple containing extra CSS classes to apply to the fieldset that is rendered for the inlines. Defaults to None. As with classes configured in fieldsets, inlines with a collapse class will be initially collapsed and their header will have a small “show” link.

admin.InlineModelAdmin.can_delete

InlineModelAdmin.can_delete Specifies whether or not inline objects can be deleted in the inline. Defaults to True.

admin.InlineModelAdmin

class InlineModelAdmin

admin.autodiscover()

autodiscover() [source] This function attempts to import an admin module in each installed application. Such modules are expected to register models with the admin. Typically you won’t need to call this function directly as AdminConfig calls it when Django starts. If you are using a custom AdminSite, it is common to import all of the ModelAdmin subclasses into your code and register them to the custom AdminSite. In that case, in order to disable auto-discovery, you should put 'django.contrib