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, **kwargs)
doc_Django
2016-10-09 18:33:43
Comments
Leave a Comment

Please login to continue.