MCPcopy
hub / github.com/django/django / model_unpickle

Function model_unpickle

django/db/models/base.py:2556–2563  ·  view source on GitHub ↗

Used to unpickle Model subclasses with deferred fields.

(model_id)

Source from the content-addressed store, hash-verified

2554
2555
2556def model_unpickle(model_id):
2557 """Used to unpickle Model subclasses with deferred fields."""
2558 if isinstance(model_id, tuple):
2559 model = apps.get_model(*model_id)
2560 else:
2561 # Backwards compat - the model was cached directly in earlier versions.
2562 model = model_id
2563 return model.__new__(model)
2564
2565
2566model_unpickle.__safe_for_unpickle__ = True

Callers

nothing calls this directly

Calls 2

get_modelMethod · 0.45
__new__Method · 0.45

Tested by

no test coverage detected