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