def _process_individual_form(self, form_name, form_classes):
"""
Perform the is_valid() check for a single form.
"""
forms = self.get_forms(form_classes, (form_name,))
form = forms.get(form_name)
if not form:
# there is no form with this name registered in the form_classes dictionary
return HttpResponseForbidden()
elif form.is_valid():
# the form is valid -> call the from valid method
return self.forms_valid(forms, form_name)
else:
# call the form invalid method
return self.forms_invalid(forms, form_name)
评论列表
文章目录