doc/book/en/B2020-hooks.en.txt
author Nicolas Chauvat <nicolas.chauvat@logilab.fr>
Wed, 03 Jun 2009 19:38:14 +0200
branchtreeview-tabs
changeset 2026 74edd1b34c52
parent 293 a21688a55d21
permissions -rw-r--r--
closing treeview-tabs branch merged into trunk.

.. -*- coding: utf-8 -*-

.. _hooks:

Hooks
=====

XXX FILLME

*Hooks* are executed before or after updating an entity or a relation in the
repository.

Their prototypes are as follows: 
    
    * after_add_entity     (session, entity)
    * after_update_entity  (session, entity)
    * after_delete_entity  (session, eid)
    * before_add_entity    (session, entity)
    * before_update_entity (session, entity)
    * before_delete_entity (session, eid)

    * after_add_relation     (session, fromeid, rtype, toeid)
    * after_delete_relation  (session, fromeid, rtype, toeid)
    * before_add_relation    (session, fromeid, rtype, toeid)
    * before_delete_relation (session, fromeid, rtype, toeid)
    
    * server_startup
    * server_shutdown
    
    * session_open
    * session_close