(self, value, model_instance)
| 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): |