MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / object_session

Method object_session

lib/sqlalchemy/orm/scoping.py:2184–2197  ·  view source on GitHub ↗

r"""Return the :class:`.Session` to which an object belongs. .. container:: class_bases Proxied for the :class:`_orm.Session` class on behalf of the :class:`_orm.scoping.scoped_session` class. This is an alias of :func:`.object_session`.

(cls, instance: object)

Source from the content-addressed store, hash-verified

2182
2183 @classmethod
2184 def object_session(cls, instance: object) -> Optional[Session]:
2185 r"""Return the :class:`.Session` to which an object belongs.
2186
2187 .. container:: class_bases
2188
2189 Proxied for the :class:`_orm.Session` class on
2190 behalf of the :class:`_orm.scoping.scoped_session` class.
2191
2192 This is an alias of :func:`.object_session`.
2193
2194
2195 """ # noqa: E501
2196
2197 return Session.object_session(instance)
2198
2199 @classmethod
2200 def identity_key(

Callers 7

scoped_session.pyFile · 0.45
test_methods_etcMethod · 0.45
test_duplicate_updateMethod · 0.45
test_expunge_cascadeMethod · 0.45
test_refreshMethod · 0.45

Calls

no outgoing calls

Tested by 5

test_methods_etcMethod · 0.36
test_duplicate_updateMethod · 0.36
test_expunge_cascadeMethod · 0.36
test_refreshMethod · 0.36