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 ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Classe « SessionEvents »

Méthode sqlalchemy.orm.SessionEvents.persistent_to_detached

Signature de la méthode persistent_to_detached

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

Description

help(SessionEvents.persistent_to_detached)

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

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


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

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


This event is invoked when a persistent object is evicted
from the session.  There are many conditions that cause this
to happen, including:

* using a method such as :meth:`.Session.expunge`
  or :meth:`.Session.close`

* Calling the :meth:`.Session.rollback` method, when the object
  was part of an INSERT statement for that session's transaction


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

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

:param deleted: boolean.  If True, indicates this object moved
 to the detached state because it was marked as deleted and flushed.


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