MCPcopy
hub / github.com/django/django / to_python

Method to_python

django/db/models/fields/composite.py:148–156  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

146 return json.dumps(values, ensure_ascii=False)
147
148 def to_python(self, value):
149 if isinstance(value, str):
150 # Assume we're deserializing.
151 vals = json.loads(value)
152 value = [
153 field.to_python(val)
154 for field, val in zip(self.fields, vals, strict=True)
155 ]
156 return value
157
158
159CompositePrimaryKey.register_lookup(TupleExact)

Callers

nothing calls this directly

Calls 1

loadsMethod · 0.45

Tested by

no test coverage detected