MCPcopy
hub / github.com/django/django / MaxLengthValidator

Class MaxLengthValidator

django/core/validators.py:489–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487
488@deconstructible
489class MaxLengthValidator(BaseValidator):
490 message = ngettext_lazy(
491 "Ensure this value has at most %(limit_value)d character (it has "
492 "%(show_value)d).",
493 "Ensure this value has at most %(limit_value)d characters (it has "
494 "%(show_value)d).",
495 "limit_value",
496 )
497 code = "max_length"
498
499 def compare(self, a, b):
500 return a > b
501
502 def clean(self, x):
503 return len(x)
504
505
506@deconstructible

Callers 2

tests.pyFile · 0.90

Calls 1

ngettext_lazyFunction · 0.90

Tested by 1