MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _after_attach

Method _after_attach

lib/sqlalchemy/orm/session.py:4443–4452  ·  view source on GitHub ↗
(self, state: InstanceState[Any], obj: object)

Source from the content-addressed store, hash-verified

4441 return True
4442
4443 def _after_attach(self, state: InstanceState[Any], obj: object) -> None:
4444 state.session_id = self.hash_key
4445 if state.modified and state._strong_obj is None:
4446 state._strong_obj = obj
4447 self.dispatch.after_attach(self, state)
4448
4449 if state.key:
4450 self.dispatch.detached_to_persistent(self, state)
4451 else:
4452 self.dispatch.transient_to_pending(self, state)
4453
4454 def __contains__(self, instance: object) -> bool:
4455 """Return True if the instance is associated with this session.

Callers 4

_delete_implMethod · 0.95
_save_implMethod · 0.95
_update_implMethod · 0.95

Calls 3

transient_to_pendingMethod · 0.80
after_attachMethod · 0.45

Tested by

no test coverage detected