Exemplo n.º 1
0
    def full_clean(self):
        self._errors = ErrorDict()
        if not self.is_bound:  # Stop further processing.
            return
        self.cleaned_data = []

        for form in self.forms:
            self._errors.update(form.errors)
            if hasattr(form, 'cleaned_data'):
                self.cleaned_data.append(form.cleaned_data)

        if self._errors:
            delattr(self, 'cleaned_data')
Exemplo n.º 2
0
 def full_clean(self):
     """
     Cleans all of self.data and populates self._errors and
     self.cleaned_data.
     """
     self._errors = ErrorDict()
     if not self.is_bound:  # Stop further processing.
         return
     self.cleaned_data = {}
     if self.empty_permitted and not self.has_changed():
         self.cleaned_data = None
         return
     for name, field in self.fields.items():
         self.clean_field(name, field)
     try:
         self.cleaned_data = self.clean()
     except ValidationError, e:
         self._errors[NON_FIELD_ERRORS] = e.messages