def clean(self, value):
        """Run validators and return the clean value."""
        if value is None:
            value = self.default

        try:
            value = self.to_python(value)
            self.validate(value)
        except ValidationError as error:
            raise ValidationError("invalid value for {}: {}".format(
                self.name,
                error.args[0]
            ))
        return value
def clean ( self , value ) : if value is None : value = self . default try : value = self . to_python ( value ) self . validate ( value ) except ValidationError as error : raise ValidationError ( "invalid value for {}: {}" . format ( self . name , error . args [ 0 ] ) ) return value
Run validators and return the clean value.