def validate(self, value): if not self.pattern.match(value): raise exceptions.ValidationError(u"Value {0} has not matched with regex.".format(value)) return True
def validate(self, value): if not self.expression.search(value.strip()): raise exceptions.ValidationError(u"Value {0} is not a valid email.".format(value)) return True
def validate(self, value): if not value >= self.min_value: raise exceptions.ValidationError(u"Value {0} is less than min value.".format(value)) return True
def validate(self, value): if not value <= self.max_value: raise exceptions.ValidationError(u"Value {0} is greater than max value.".format(value)) return True
def validate(self, value): if not self.min_value <= value <= self.max_value: raise exceptions.ValidationError(u"Value {0} is out of range.".format(value)) return True
def _to_python(self, value): if value != self.identifier: raise exceptions.ValidationError() return self.identifier
def _to_python(self, value): if value not in self.values: raise exceptions.ValidationError(u"Value {} is not a valid value.") return value