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 fondamentaux
Voir le programme détaillé
Classe « SessionEvents »

Méthode sqlalchemy.orm.SessionEvents.after_bulk_update

Signature de la méthode after_bulk_update

def after_bulk_update(self, update_context: '_O') -> 'None' 

Description

help(SessionEvents.after_bulk_update)

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

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeSessionClassOrObject, 'after_bulk_update')
        def receive_after_bulk_update(update_context):
            "listen for the 'after_bulk_update' event"

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

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

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

.. versionchanged:: 0.9
    The :meth:`.SessionEvents.after_bulk_update` event now accepts the 
    arguments :paramref:`.SessionEvents.after_bulk_update.update_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_update` 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.update` 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 update_context: an "update 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.
    * ``values`` The "values" dictionary that was passed to
      :meth:`_query.Query.update`.
    * ``result`` the :class:`_engine.CursorResult`
      returned as a result of the
      bulk UPDATE operation.

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

.. seealso::

    :meth:`.QueryEvents.before_compile_update`

    :meth:`.SessionEvents.after_bulk_delete`



Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé