Esempio n. 1
0
 def get_changelist_formset(self, request, **kwargs):
     """
     Returns a FormSet class for use on the changelist page if list_editable
     is used.
     """
     defaults = {
         "formfield_callback": partial(self.formfield_for_dbfield, request=request),
     }
     defaults.update(kwargs)
     return documentformset_factory(
         self.model, self.get_changelist_form(request), extra=0,
         fields=self.list_editable, **defaults
     )
Esempio n. 2
0
 def get_changelist_formset(self, request, **kwargs):
     """
     Returns a FormSet class for use on the changelist page if list_editable
     is used.
     """
     defaults = {
         "formfield_callback": partial(self.formfield_for_dbfield, request=request),
     }
     defaults.update(kwargs)
     return documentformset_factory(
         self.model, self.get_changelist_form(request), extra=0,
         fields=self.list_editable, **defaults
     )