Event for after the legacy :meth:`_orm.Query.delete` method has been called. .. 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
(self, delete_context: _O)
| 2149 | ), |
| 2150 | ) |
| 2151 | def after_bulk_delete(self, delete_context: _O) -> None: |
| 2152 | """Event for after the legacy :meth:`_orm.Query.delete` method |
| 2153 | has been called. |
| 2154 | |
| 2155 | .. legacy:: The :meth:`_orm.SessionEvents.after_bulk_delete` method |
| 2156 | is a legacy event hook as of SQLAlchemy 2.0. The event |
| 2157 | **does not participate** in :term:`2.0 style` invocations |
| 2158 | using :func:`_dml.delete` documented at |
| 2159 | :ref:`orm_queryguide_update_delete_where`. For 2.0 style use, |
| 2160 | the :meth:`_orm.SessionEvents.do_orm_execute` hook will intercept |
| 2161 | these calls. |
| 2162 | |
| 2163 | :param delete_context: a "delete context" object which contains |
| 2164 | details about the update, including these attributes: |
| 2165 | |
| 2166 | * ``session`` - the :class:`.Session` involved |
| 2167 | * ``query`` -the :class:`_query.Query` |
| 2168 | object that this update operation |
| 2169 | was called upon. |
| 2170 | * ``result`` the :class:`_engine.CursorResult` |
| 2171 | returned as a result of the |
| 2172 | bulk DELETE operation. |
| 2173 | |
| 2174 | .. versionchanged:: 1.4 the update_context no longer has a |
| 2175 | ``QueryContext`` object associated with it. |
| 2176 | |
| 2177 | .. seealso:: |
| 2178 | |
| 2179 | :meth:`.QueryEvents.before_compile_delete` |
| 2180 | |
| 2181 | :meth:`.SessionEvents.after_bulk_update` |
| 2182 | |
| 2183 | """ |
| 2184 | |
| 2185 | @_lifecycle_event |
| 2186 | def transient_to_pending(self, session: Session, instance: _O) -> None: |