MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __call__

Method __call__

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

Source from the content-addressed store, hash-verified

575 manager.dispatch.pickle(state, d)
576
577 def __call__(self, state, inst, state_dict):
578 state.manager = manager = opt_manager_of_class(self.class_)
579 if manager is None:
580 raise exc.UnmappedInstanceError(
581 inst,
582 "Cannot deserialize object of type %r - "
583 "no mapper() has "
584 "been configured for this class within the current "
585 "Python process!" % self.class_,
586 )
587 elif manager.is_mapped and not manager.mapper.configured:
588 manager.mapper._check_configure()
589
590 # setup _sa_instance_state ahead of time so that
591 # unpickle events can access the object normally.
592 # see [ticket:2362]
593 if inst is not None:
594 manager.setup_instance(inst, state)
595 manager.dispatch.unpickle(state, state_dict)
596
597
598class 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