Class BaseModelFormSet
A ``FormSet`` for editing a queryset and/or adding new objects to it.
Declaration
source linkDocumentation
Methods
▶ def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, queryset=None, *, ...) override def __init__(
self,
data=None,
files=None,
auto_id='id_%s',
prefix=None,
queryset=None,
*,
initial=None,
**kwargs,
)
This method overrides django.forms.formsets.BaseFormSet.__init__.
Overrides
This method is overriden in:
▶ def add_fields(self, form, index) override Add a hidden field for the object's primary key.
▶ def clean(self) overrideinherited doc Hook for doing any extra formset-wide cleaning after Form.clean() has
This method overrides django.forms.formsets.BaseFormSet.clean.
been called on every form. Any ValidationError raised by this method
will not be associated with a particular form; it will be accessible
via formset.non_form_errors()
▷ def delete_existing(self, obj, commit=True) Deletes an existing model instance.
Overrides
This method is overriden in:
▶ def initial_form_count(self) override Return the number of forms that are required in this FormSet.
▷ def save(self, commit=True) Save model instances for every form, adding and changing instances as necessary, and return the list of instances.
▷ def save_existing(self, form, instance, commit=True) Save and return an existing model instance for the given form.
▶ def save_new(self, form, commit=True) Save and return a new model instance for the given form.
Overrides
This method is overriden in: