# HG changeset patch # User Noe Gaumont # Date 1558517529 -7200 # Node ID 4e7ff3dd79fdd120da763279e54a24e2c71f73c4 # Parent a068ce6329b51d5bcc6dd4bb5bf1f4591f37d360 [doc] set_operation has been replaced by add_data See the changelog https://cubicweb.readthedocs.io/en/3.26/changes/changelog/#id14 diff -r a068ce6329b5 -r 4e7ff3dd79fd doc/book/devrepo/repo/hooks.rst --- a/doc/book/devrepo/repo/hooks.rst Wed May 22 11:30:52 2019 +0200 +++ b/doc/book/devrepo/repo/hooks.rst Wed May 22 11:32:09 2019 +0200 @@ -135,8 +135,6 @@ .. sourcecode:: python - from cubicweb.server.hook import set_operation - class CheckSubsidiaryCycleHook(Hook): __regid__ = 'check_no_subsidiary_cycle' events = ('after_add_relation',) @@ -152,11 +150,11 @@ check_cycle(self.session, eid, self.rtype) -Here, we call :func:`set_operation` so that we will simply accumulate eids of +Here, we call :func:`add_data` so that we will simply accumulate eids of entities to check at the end in a single `CheckSubsidiaryCycleOp` operation. Values are stored in a set associated to the 'subsidiary_cycle_detection' transaction data key. The set initialization and -operation creation are handled nicely by :func:`set_operation`. +operation creation are handled nicely by :func:`add_data`. A more realistic example can be found in the advanced tutorial chapter :ref:`adv_tuto_security_propagation`.