Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Classe « SessionEvents »

Méthode sqlalchemy.orm.SessionEvents.pending_to_transient

Signature de la méthode pending_to_transient

def pending_to_transient(self, session, instance) 

Description

pending_to_transient.__doc__

Intercept the "pending to transient" transition for a specific object.

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeSessionOrFactory, 'pending_to_transient')
        def receive_pending_to_transient(session, instance):
            "listen for the 'pending_to_transient' event"

            # ... (event handling logic) ...


This less common transition occurs when an pending object that has
not been flushed is evicted from the session; this can occur
when the :meth:`.Session.rollback` method rolls back the transaction,
or when the :meth:`.Session.expunge` method is used.

:param session: target :class:`.Session`

:param instance: the ORM-mapped instance being operated upon.

.. versionadded:: 1.1

.. seealso::

    :ref:`session_lifecycle_events`