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 ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé
Classe « AttributeEvents »

Méthode sqlalchemy.orm.AttributeEvents.remove

Signature de la méthode remove

def remove(self, target: '_O', value: '_T', initiator: 'Event', *, key: 'EventConstants' = <EventConstants.NO_KEY: 4>) -> 'None' 

Description

help(AttributeEvents.remove)

Receive a collection remove event.

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeClass.some_attribute, 'remove')
        def receive_remove(target, value, initiator):
            "listen for the 'remove' event"

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


:param target: the object instance receiving the event.
  If the listener is registered with ``raw=True``, this will
  be the :class:`.InstanceState` object.
:param value: the value being removed.
:param initiator: An instance of :class:`.attributes.Event`
  representing the initiation of the event.  May be modified
  from its original value by backref handlers in order to control
  chained event propagation.

:param key: When the event is established using the
 :paramref:`.AttributeEvents.include_key` parameter set to
 True, this will be the key used in the operation, such as
 ``del collection[some_key_or_index]``.  The parameter is not passed
 to the event at all if the the
 :paramref:`.AttributeEvents.include_key`
 was not used to set up the event; this is to allow backwards
 compatibility with existing event handlers that don't include the
 ``key`` parameter.

 .. versionadded:: 2.0

:return: No return value is defined for this event.


.. seealso::

    :class:`.AttributeEvents` - background on listener options such
    as propagation to subclasses.



Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé