def is_valid(self):
self.cleaned_data = {}<EOL>self.changed_fields = []<EOL>self.validated = False<EOL>self._errors = {}<EOL>self._named_errors = {}<EOL>cleaned_data = {}<EOL>changed_fields = []<EOL>errors = {}<EOL>named_errors = {}<EOL>for name, subform in self._forms.items():<EOL><INDENT>if not subform.is_valid():<EOL><INDENT>errors[name] = subform._errors<EOL>named_errors.update(subform._named_errors)<EOL>continue<EOL><DEDENT>if subform.has_changed:<EOL><INDENT>changed_fields.append(name)<EOL><DEDENT><DEDENT>for name, formset in self._sets.items():<EOL><INDENT>if not formset.is_valid():<EOL><INDENT>errors[name] = formset._errors<EOL>named_errors.update(formset._named_errors)<EOL>continue<EOL><DEDENT>if formset.has_changed:<EOL><INDENT>changed_fields.append(name)<EOL><DEDENT><DEDENT>for name, field in self._fields.items():<EOL><INDENT>field.error = None<EOL>py_value = field.validate(self)<EOL>if field.error:<EOL><INDENT>errors[name] = field.error<EOL>named_errors[field.name] = field.error<EOL>continue<EOL><DEDENT>cleaned_data[name] = py_value<EOL>if hasattr(field, '<STR_LIT>'):<EOL><INDENT>cleaned_data[name] = None<EOL>field.has_changed = True<EOL><DEDENT>if field.has_changed:<EOL><INDENT>changed_fields.append(name)<EOL><DEDENT><DEDENT>for name, field in self._fields.items():<EOL><INDENT>field.validate(self, cleaned_data)<EOL>if field.error:<EOL><INDENT>errors[name] = field.error<EOL>named_errors[field.name] = field.error<EOL>continue<EOL><DEDENT><DEDENT>if errors:<EOL><INDENT>self._errors = errors<EOL>self._named_errors = named_errors<EOL>return False<EOL><DEDENT>self.changed_fields = changed_fields<EOL>self.cleaned_data = self.clean(cleaned_data)<EOL>self.validated = True<EOL>return True<EOL>
Return whether the current values of the form fields are all valid.