code: def save_formset(self, request, form, formset, change):
          
          formset.save()
  
          for form in formset.forms:
              if hasattr(form, 'nested_formsets') and form not in formset.deleted_forms:
                  for nested_formset in form.nested_formsets:
                      self.save_formset(request, form, nested_formset, change)
docs: Given an inline formset save it to the database.