MCPcopy
hub / github.com/django/django / validate

Method validate

django/contrib/postgres/forms/array.py:68–84  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

66 return values
67
68 def validate(self, value):
69 super().validate(value)
70 errors = []
71 for index, item in enumerate(value):
72 try:
73 self.base_field.validate(item)
74 except ValidationError as error:
75 errors.append(
76 prefix_validation_error(
77 error,
78 prefix=self.error_messages["item_invalid"],
79 code="item_invalid",
80 params={"nth": index + 1},
81 )
82 )
83 if errors:
84 raise ValidationError(errors)
85
86 def run_validators(self, value):
87 super().run_validators(value)

Callers

nothing calls this directly

Calls 3

prefix_validation_errorFunction · 0.90
ValidationErrorClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected