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 :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé
Classe « SessionEvents »

Méthode sqlalchemy.orm.SessionEvents.persistent_to_transient

Signature de la méthode persistent_to_transient

def persistent_to_transient(self, session: 'Session', instance: '_O') -> 'None' 

Description

help(SessionEvents.persistent_to_transient)

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

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeSessionClassOrObject, 'persistent_to_transient')
        def receive_persistent_to_transient(session, instance):
            "listen for the 'persistent_to_transient' event"

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


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

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

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

.. seealso::

    :ref:`session_lifecycle_events`



Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé