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

Method transient_to_pending

lib/sqlalchemy/orm/events.py:2186–2203  ·  view source on GitHub ↗

Intercept the "transient to pending" transition for a specific object. This event is a specialization of the :meth:`.SessionEvents.after_attach` event which is only invoked for this specific transition. It is invoked typically during the :meth:`.Session.add`

(self, session: Session, instance: _O)

Source from the content-addressed store, hash-verified

2184
2185 @_lifecycle_event
2186 def transient_to_pending(self, session: Session, instance: _O) -> None:
2187 """Intercept the "transient to pending" transition for a specific
2188 object.
2189
2190 This event is a specialization of the
2191 :meth:`.SessionEvents.after_attach` event which is only invoked
2192 for this specific transition. It is invoked typically during the
2193 :meth:`.Session.add` call.
2194
2195 :param session: target :class:`.Session`
2196
2197 :param instance: the ORM-mapped instance being operated upon.
2198
2199 .. seealso::
2200
2201 :ref:`session_lifecycle_events`
2202
2203 """
2204
2205 @_lifecycle_event
2206 def pending_to_transient(self, session: Session, instance: _O) -> None:

Callers 2

_after_attachMethod · 0.80

Calls

no outgoing calls

Tested by 1