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

Method validate

django/contrib/postgres/fields/hstore.py:31–39  ·  view source on GitHub ↗
(self, value, model_instance)

Source from the content-addressed store, hash-verified

29 return KeyTransformFactory(name)
30
31 def validate(self, value, model_instance):
32 super().validate(value, model_instance)
33 for key, val in value.items():
34 if not isinstance(val, str) and val is not None:
35 raise exceptions.ValidationError(
36 self.error_messages["not_a_string"],
37 code="not_a_string",
38 params={"key": key},
39 )
40
41 def to_python(self, value):
42 if isinstance(value, str):

Callers

nothing calls this directly

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected