MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / __call__

Method __call__

lib/sqlalchemy/orm/instrumentation.py:585–603  ·  view source on GitHub ↗
(self, state, inst, state_dict)

Source from the content-addressed store, hash-verified

583 manager.dispatch.pickle(state, d)
584
585 def __call__(self, state, inst, state_dict):
586 state.manager = manager = opt_manager_of_class(self.class_)
587 if manager is None:
588 raise exc.UnmappedInstanceError(
589 inst,
590 "Cannot deserialize object of type %r - "
591 "no mapper() has "
592 "been configured for this class within the current "
593 "Python process!" % self.class_,
594 )
595 elif manager.is_mapped and not manager.mapper.configured:
596 manager.mapper._check_configure()
597
598 # setup _sa_instance_state ahead of time so that
599 # unpickle events can access the object normally.
600 # see [ticket:2362]
601 if inst is not None:
602 manager.setup_instance(inst, state)
603 manager.dispatch.unpickle(state, state_dict)
604
605
606class InstrumentationFactory(EventTarget):

Callers

nothing calls this directly

Calls 4

opt_manager_of_classFunction · 0.85
_check_configureMethod · 0.80
setup_instanceMethod · 0.45
unpickleMethod · 0.45

Tested by

no test coverage detected