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

Method _after_attach

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

Source from the content-addressed store, hash-verified

4285 return True
4286
4287 def _after_attach(self, state: InstanceState[Any], obj: object) -> None:
4288 state.session_id = self.hash_key
4289 if state.modified and state._strong_obj is None:
4290 state._strong_obj = obj
4291 self.dispatch.after_attach(self, state)
4292
4293 if state.key:
4294 self.dispatch.detached_to_persistent(self, state)
4295 else:
4296 self.dispatch.transient_to_pending(self, state)
4297
4298 def __contains__(self, instance: object) -> bool:
4299 """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