Ticket #4297: 4297.diff

File 4297.diff, 1.8 KB (added by Gary Wilson <gary.wilson@…>, 17 years ago)

changed __errors to _errors

  • django/newforms/forms.py

    === modified file 'django/newforms/forms.py'
     
    6161        self.auto_id = auto_id
    6262        self.prefix = prefix
    6363        self.initial = initial or {}
    64         self.__errors = None # Stores the errors after clean() has been called.
     64        self._errors = None # Stores the errors after clean() has been called.
    6565
    6666        # The base_fields class attribute is the *class-wide* definition of
    6767        # fields. Because a particular *instance* of the class might want to
     
    8585            raise KeyError('Key %r not found in Form' % name)
    8686        return BoundField(self, field, name)
    8787
    88     def _errors(self):
     88    def _get_errors(self):
    8989        "Returns an ErrorDict for self.data"
    90         if self.__errors is None:
     90        if self._errors is None:
    9191            self.full_clean()
    92         return self.__errors
    93     errors = property(_errors)
     92        return self._errors
     93    errors = property(_get_errors)
    9494
    9595    def is_valid(self):
    9696        """
     
    169169
    170170    def full_clean(self):
    171171        """
    172         Cleans all of self.data and populates self.__errors and self.cleaned_data.
     172        Cleans all of self.data and populates self._errors and
     173        self.cleaned_data.
    173174        """
    174175        errors = ErrorDict()
    175176        if not self.is_bound: # Stop further processing.
    176             self.__errors = errors
     177            self._errors = errors
    177178            return
    178179        self.cleaned_data = {}
    179180        for name, field in self.fields.items():
     
    195196            errors[NON_FIELD_ERRORS] = e.messages
    196197        if errors:
    197198            delattr(self, 'cleaned_data')
    198         self.__errors = errors
     199        self._errors = errors
    199200
    200201    def clean(self):
    201202        """
Back to Top