class documentation

class BaseModelFormSet(BaseFormSet):

Known subclasses: django.contrib.contenttypes.forms.BaseGenericInlineFormSet, django.forms.models.BaseInlineFormSet

View In Hierarchy

A FormSet for editing a queryset and/or adding new objects to it.
Instance Variable changed​_objects Undocumented
Instance Variable deleted​_objects Undocumented
Instance Variable new​_objects Undocumented
Method __init__ Undocumented
Method ​_construct​_form Instantiate and return the i-th form instance in a formset.
Method ​_existing​_object Undocumented
Method ​_get​_to​_python If the field is a related field, fetch the concrete field's (that is, the ultimate pointed-to field's) to_python.
Method add​_fields Add a hidden field for the object's primary key.
Method clean No summary
Method delete​_existing Deletes an existing model instance.
Method get​_date​_error​_message Undocumented
Method get​_form​_error Undocumented
Method get​_queryset Undocumented
Method get​_unique​_error​_message Undocumented
Method initial​_form​_count Return the number of forms that are required in this FormSet.
Method save Save model instances for every form, adding and changing instances as necessary, and return the list of instances.
Method save​_existing Save and return an existing model instance for the given form.
Method save​_existing​_objects Undocumented
Method save​_new Save and return a new model instance for the given form.
Method save​_new​_objects Undocumented
Method validate​_unique Undocumented
Class Variable model Undocumented
Class Variable unique​_fields Undocumented
Instance Variable ​_object​_dict Undocumented
Instance Variable ​_pk​_field Undocumented
Instance Variable ​_queryset Undocumented
Instance Variable initial​_extra Undocumented
Instance Variable queryset Undocumented
Instance Variable save​_m2m Undocumented
Instance Variable saved​_forms Undocumented

Inherited from BaseFormSet:

Class Method get​_default​_prefix Undocumented
Class Method get​_deletion​_widget Undocumented
Class Method get​_ordering​_widget Undocumented
Method get​_context Undocumented
Method total​_error​_count Return the number of errors across all forms in the formset.
Class Variable template​_name Undocumented
Class Variable template​_name​_p Undocumented
Class Variable template​_name​_table Undocumented
Class Variable template​_name​_ul Undocumented
Method __bool__ Return True since all formsets have a management form which is not included in the length.
Method __getitem__ Return the form at the given index, based on the rendering order.
Method __iter__ Yield the forms in the order they should be rendered.
Method __len__ Undocumented
Method ​_should​_delete​_form Return whether or not the form was marked for deletion.
Method add​_prefix Undocumented
Method full​_clean Clean all of self.data and populate self._errors and self._non_form_errors.
Method get​_form​_kwargs Return additional keyword arguments for each individual formset form.
Method has​_changed Return True if data in any form differs from initial.
Method is​_multipart Return True if the formset needs to be multipart, i.e. it has FileInput, or False otherwise.
Method is​_valid Return True if every form in self.forms is valid.
Method non​_form​_errors Return an ErrorList of errors that aren't associated with a particular form -- i.e., from formset.clean(). Return an empty ErrorList if there are none.
Method total​_form​_count Return the total number of forms in this FormSet.
Class Variable default​_error​_messages Undocumented
Instance Variable ​_errors Undocumented
Instance Variable ​_non​_form​_errors Undocumented
Instance Variable auto​_id Undocumented
Instance Variable data Undocumented
Instance Variable error​_class Undocumented
Instance Variable error​_messages Undocumented
Instance Variable files Undocumented
Instance Variable form​_kwargs Undocumented
Instance Variable initial Undocumented
Instance Variable is​_bound Undocumented
Instance Variable prefix Undocumented
Property cleaned​_data Return a list of form.cleaned_data dicts for every form in self.forms.
Property deleted​_forms Return a list of forms that have been marked for deletion.
Property empty​_form Undocumented
Property errors Return a list of form.errors for every form in self.forms.
Property extra​_forms Return a list of all the extra forms in this formset.
Property forms Instantiate forms at first property access.
Property initial​_forms Return a list of all the initial forms in this formset.
Property management​_form Return the ManagementForm instance for this FormSet.
Property media Undocumented
Property ordered​_forms Return a list of form in the order specified by the incoming data. Raise an AttributeError if ordering is not allowed.

Inherited from RenderableFormMixin (via BaseFormSet):

Method as​_p Render as <p> elements.
Method as​_table Render as <tr> elements excluding the surrounding <table> tag.
Method as​_ul Render as <li> elements excluding the surrounding <ul> tag.

Inherited from RenderableMixin (via BaseFormSet, RenderableFormMixin):

Method render Undocumented
changed_objects: list =

Undocumented

deleted_objects: list =

Undocumented

new_objects: list =

Undocumented

def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, queryset=None, *, initial=None, **kwargs):
def _construct_form(self, i, **kwargs):
Instantiate and return the i-th form instance in a formset.
def _existing_object(self, pk):

Undocumented

def _get_to_python(self, field):
If the field is a related field, fetch the concrete field's (that is, the ultimate pointed-to field's) to_python.
def add_fields(self, form, index):
Add a hidden field for the object's primary key.
def clean(self):
Hook for doing any extra formset-wide cleaning after Form.clean() has 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.
def get_date_error_message(self, date_check):

Undocumented

def get_form_error(self):

Undocumented

def get_queryset(self):

Undocumented

def get_unique_error_message(self, unique_check):

Undocumented

def initial_form_count(self):
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_existing_objects(self, commit=True):

Undocumented

def save_new(self, form, commit=True):
Save and return a new model instance for the given form.
def save_new_objects(self, commit=True):

Undocumented

def validate_unique(self):

Undocumented

model =

Undocumented

unique_fields: set =

Undocumented

_object_dict =

Undocumented

_pk_field =

Undocumented

_queryset =

Undocumented

initial_extra =

Undocumented

queryset =

Undocumented

save_m2m =

Undocumented

saved_forms: list =

Undocumented