MCPcopy
hub / github.com/encode/django-rest-framework / run_validators

Method run_validators

rest_framework/serializers.py:482–491  ·  view source on GitHub ↗

Add read_only fields with defaults to value before running validators.

(self, value)

Source from the content-addressed store, hash-verified

480 return defaults
481
482 def run_validators(self, value):
483 """
484 Add read_only fields with defaults to value before running validators.
485 """
486 if isinstance(value, dict):
487 to_validate = self._read_only_defaults()
488 to_validate.update(value)
489 else:
490 to_validate = value
491 super().run_validators(to_validate)
492
493 def to_internal_value(self, data):
494 """

Callers 2

run_validationMethod · 0.95
run_validationMethod · 0.45

Calls 2

_read_only_defaultsMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected