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 :

Classe « AttributeEvents »

Méthode sqlalchemy.orm.AttributeEvents.modified

Signature de la méthode modified

def modified(self, target, initiator) 

Description

modified.__doc__

Receive a 'modified' event.

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeClass.some_attribute, 'modified')
        def receive_modified(target, initiator):
            "listen for the 'modified' event"

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


This event is triggered when the :func:`.attributes.flag_modified`
function is used to trigger a modify event on an attribute without
any specific value being set.

.. versionadded:: 1.2

:param target: the object instance receiving the event.
  If the listener is registered with ``raw=True``, this will
  be the :class:`.InstanceState` object.

:param initiator: An instance of :class:`.attributes.Event`
  representing the initiation of the event.

.. seealso::

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