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.first_init

Signature de la méthode first_init

def first_init(self, manager, cls) 

Description

first_init.__doc__

Called when the first instance of a particular mapping is called.

.. container:: event_signatures

     Example argument forms::

        from sqlalchemy import event


        @event.listens_for(SomeClass, 'first_init')
        def receive_first_init(manager, cls):
            "listen for the 'first_init' event"

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


This event is called when the ``__init__`` method of a class
is called the first time for that particular class.    The event
invokes before ``__init__`` actually proceeds as well as before
the :meth:`.InstanceEvents.init` event is invoked.