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 « InstanceEvents »

Méthode sqlalchemy.orm.InstanceEvents.pickle

Signature de la méthode pickle

def pickle(self, target, state_dict) 

Description

pickle.__doc__

Receive an object instance when its associated state is
being pickled.

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeClass, 'pickle')
        def receive_pickle(target, state_dict):
            "listen for the 'pickle' event"

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


:param target: the mapped instance.  If
 the event is configured with ``raw=True``, this will
 instead be the :class:`.InstanceState` state-management
 object associated with the instance.
:param state_dict: the dictionary returned by
 :class:`.InstanceState.__getstate__`, containing the state
 to be pickled.