hooks/test/data/hooks.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 16 Jun 2016 14:19:20 +0200 (2016-06-16)
changeset 11278 19fcce6dc6d1
parent 11084 ffd615e626f9
permissions -rw-r--r--
backport changes from 3.21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11084
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     1
from cubicweb.predicates import is_instance
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     2
from cubicweb.hooks import notification
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     3
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     4
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     5
class FolderUpdateHook(notification.EntityUpdateHook):
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     6
    __select__ = (notification.EntityUpdateHook.__select__ &
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     7
                  is_instance('Folder'))
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     8
    order = 100  # late trigger so that metadata hooks come before.