def _validate(self):
        """Validate model data and save errors
        """
        errors = {}

        for name, validator in self._validators.items():
            value = getattr(self, name)

            try:
                validator(self, value)
            except ValidationError as e:
                errors[name] = str(e)

        self._validate_errors = errors
def _validate ( self ) : errors = { } for name , validator in self . _validators . items ( ) : value = getattr ( self , name ) try : validator ( self , value ) except ValidationError as e : errors [ name ] = str ( e ) self . _validate_errors = errors
Validate model data and save errors