admin.ModelAdmin.get_list_filter()

ModelAdmin.get_list_filter(request) [source] The get_list_filter method is given the HttpRequest and is expected to return the same kind of sequence type as for the list_filter attribute.

admin.ModelAdmin.get_list_display_links()

ModelAdmin.get_list_display_links(request, list_display) [source] The get_list_display_links method is given the HttpRequest and the list or tuple returned by ModelAdmin.get_list_display(). It is expected to return either None or a list or tuple of field names on the changelist that will be linked to the change view, as described in the ModelAdmin.list_display_links section.

admin.ModelAdmin.get_list_display()

ModelAdmin.get_list_display(request) [source] The get_list_display method is given the HttpRequest and is expected to return a list or tuple of field names that will be displayed on the changelist view as described above in the ModelAdmin.list_display section.

admin.ModelAdmin.get_inline_instances()

ModelAdmin.get_inline_instances(request, obj=None) [source] The get_inline_instances method is given the HttpRequest and the obj being edited (or None on an add form) and is expected to return a list or tuple of InlineModelAdmin objects, as described below in the InlineModelAdmin section. For example, the following would return inlines without the default filtering based on add, change, and delete permissions: class MyModelAdmin(admin.ModelAdmin): inlines = (MyInline,) def get_inlin

admin.ModelAdmin.get_formsets_with_inlines()

ModelAdmin.get_formsets_with_inlines(request, obj=None) [source] Yields (FormSet, InlineModelAdmin) pairs for use in admin add and change views. For example if you wanted to display a particular inline only in the change view, you could override get_formsets_with_inlines as follows: class MyModelAdmin(admin.ModelAdmin): inlines = [MyInline, SomeOtherInline] def get_formsets_with_inlines(self, request, obj=None): for inline in self.get_inline_instances(request, obj):

admin.ModelAdmin.get_form()

ModelAdmin.get_form(request, obj=None, **kwargs) [source] Returns a ModelForm class for use in the admin add and change views, see add_view() and change_view(). The base implementation uses modelform_factory() to subclass form, modified by attributes such as fields and exclude. So, for example, if you wanted to offer additional fields to superusers, you could swap in a different base form like so: class MyModelAdmin(admin.ModelAdmin): def get_form(self, request, obj=None, **kwargs):

admin.ModelAdmin.get_fieldsets()

ModelAdmin.get_fieldsets(request, obj=None) The get_fieldsets method is given the HttpRequest and the obj being edited (or None on an add form) and is expected to return a list of two-tuples, in which each two-tuple represents a <fieldset> on the admin form page, as described above in the ModelAdmin.fieldsets section.

admin.ModelAdmin.get_fields()

ModelAdmin.get_fields(request, obj=None) [source] The get_fields method is given the HttpRequest and the obj being edited (or None on an add form) and is expected to return a list of fields, as described above in the ModelAdmin.fields section.

admin.ModelAdmin.get_changelist_formset()

ModelAdmin.get_changelist_formset(request, **kwargs) [source] Returns a ModelFormSet class for use on the changelist page if list_editable is used. To use a custom formset, for example: from django.forms import BaseModelFormSet class MyAdminFormSet(BaseModelFormSet): pass class MyModelAdmin(admin.ModelAdmin): def get_changelist_formset(self, request, **kwargs): kwargs['formset'] = MyAdminFormSet return super(MyModelAdmin, self).get_changelist_formset(request, **kwar

admin.ModelAdmin.get_changelist_form()

ModelAdmin.get_changelist_form(request, **kwargs) [source] Returns a ModelForm class for use in the Formset on the changelist page. To use a custom form, for example: from django import forms class MyForm(forms.ModelForm): pass class MyModelAdmin(admin.ModelAdmin): def get_changelist_form(self, request, **kwargs): return MyForm Note If you define the Meta.model attribute on a ModelForm, you must also define the Meta.fields attribute (or the Meta.exclude attribute). Howeve