hooks/test/data/hooks.py
author David Douard <david.douard@logilab.fr>
Tue, 19 Jul 2016 19:50:48 +0200
branch3.22
changeset 11436 dca6ae982ee5
parent 11084 ffd615e626f9
permissions -rw-r--r--
[cwconfig] add the CubicWebConfiguration.ensure_uid_directory() method (related to #11298794) that recursively enforce uid on files.

from cubicweb.predicates import is_instance
from cubicweb.hooks import notification


class FolderUpdateHook(notification.EntityUpdateHook):
    __select__ = (notification.EntityUpdateHook.__select__ &
                  is_instance('Folder'))
    order = 100  # late trigger so that metadata hooks come before.