MCPcopy Index your code
hub / github.com/encode/django-rest-framework / to_internal_value

Method to_internal_value

rest_framework/fields.py:700–708  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

698 return value
699
700 def to_internal_value(self, data):
701 with contextlib.suppress(TypeError):
702 if self._lower_if_str(data) in self.TRUE_VALUES:
703 return True
704 elif self._lower_if_str(data) in self.FALSE_VALUES:
705 return False
706 elif self._lower_if_str(data) in self.NULL_VALUES and self.allow_null:
707 return None
708 self.fail("invalid", input=data)
709
710 def to_representation(self, value):
711 if self._lower_if_str(value) in self.TRUE_VALUES:

Callers

nothing calls this directly

Calls 2

_lower_if_strMethod · 0.95
failMethod · 0.80

Tested by

no test coverage detected