hooks/test/data/hooks.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 03 Feb 2016 14:23:17 +0100
changeset 11091 29aebc1edd29
parent 11084 ffd615e626f9
permissions -rw-r--r--
[repository] drop usage of no more necessary eschema_eid function since the previous cset, we are guaranteed that repository's entity schema will have their eid attribute properly set, so we don't have anymore to check everytime if some entity schema's .eid attributes is set or not (and retrieve it if not). Related to #10450092
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.