Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To save information that has been initiated through programming into BaseInlineFormSet, you can call the save() method on the formset object. This will save any changes made to the form data and create or update the corresponding database records.

Example:

formset = MyInlineFormSet(request.POST, instance=my_instance)
if formset.is_valid():
    formset.save()

In this example, we instantiate the formset object with the POST data from the request and an instance of the model being edited. If the formset is valid, we call the save() method to save any changes made to the form data.