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.transient_to_pending

Signature de la méthode transient_to_pending

def transient_to_pending(self, session, instance) 

Description

transient_to_pending.__doc__

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

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


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

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


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` call.

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

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

.. versionadded:: 1.1

.. seealso::

    :ref:`session_lifecycle_events`