admin.ModelAdmin.get_list_select_related()

ModelAdmin.get_list_select_related(request) [source] New in Django 1.9. The get_list_select_related method is given the HttpRequest and should return a boolean or list as ModelAdmin.list_select_related does.

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()

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_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_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_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_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_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()

ModelAdmin.get_changelist(request, **kwargs) [source] Returns the Changelist class to be used for listing. By default, django.contrib.admin.views.main.ChangeList is used. By inheriting this class you can change the behavior of the listing.