MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / __call__

Method __call__

tortoise/validators.py:31–33  ·  view source on GitHub ↗
(self, value: Any)

Source from the content-addressed store, hash-verified

29 self.regex = re.compile(pattern, flags)
30
31 def __call__(self, value: Any) -> None:
32 if not self.regex.match(value):
33 raise ValidationError(f"Value '{value}' does not match regex '{self.regex.pattern}'")
34
35
36class MaxLengthValidator(Validator):

Callers

nothing calls this directly

Calls 1

ValidationErrorClass · 0.90

Tested by

no test coverage detected