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 ? Calcul scientifique
avec Python
Voir le programme détaillé
Classe « SessionEvents »

Méthode sqlalchemy.orm.SessionEvents.after_bulk_delete

Signature de la méthode after_bulk_delete

def after_bulk_delete(self, delete_context: '_O') -> 'None' 

Description

help(SessionEvents.after_bulk_delete)

Event for after the legacy :meth:`_orm.Query.delete` method
has been called.

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeSessionClassOrObject, 'after_bulk_delete')
        def receive_after_bulk_delete(delete_context):
            "listen for the 'after_bulk_delete' event"

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

        # DEPRECATED calling style (pre-0.9, will be removed in a future release)
        @event.listens_for(SomeSessionClassOrObject, 'after_bulk_delete')
        def receive_after_bulk_delete(session, query, query_context, result):
            "listen for the 'after_bulk_delete' event"

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

.. versionchanged:: 0.9
    The :meth:`.SessionEvents.after_bulk_delete` event now accepts the 
    arguments :paramref:`.SessionEvents.after_bulk_delete.delete_context`.
    Support for listener functions which accept the previous 
    argument signature(s) listed above as "deprecated" will be 
    removed in a future release.

.. legacy:: The :meth:`_orm.SessionEvents.after_bulk_delete` method
   is a legacy event hook as of SQLAlchemy 2.0.   The event
   **does not participate** in :term:`2.0 style` invocations
   using :func:`_dml.delete` documented at
   :ref:`orm_queryguide_update_delete_where`.  For 2.0 style use,
   the :meth:`_orm.SessionEvents.do_orm_execute` hook will intercept
   these calls.

:param delete_context: a "delete context" object which contains
 details about the update, including these attributes:

    * ``session`` - the :class:`.Session` involved
    * ``query`` -the :class:`_query.Query`
      object that this update operation
      was called upon.
    * ``result`` the :class:`_engine.CursorResult`
      returned as a result of the
      bulk DELETE operation.

.. versionchanged:: 1.4 the update_context no longer has a
   ``QueryContext`` object associated with it.

.. seealso::

    :meth:`.QueryEvents.before_compile_delete`

    :meth:`.SessionEvents.after_bulk_update`



Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé