hooks/test/data/hooks.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Tue, 01 Dec 2015 16:10:18 +0100
changeset 11084 ffd615e626f9
permissions -rw-r--r--
[hooks] Skip modification_date attribute in "notifentityupdated" hook Depending on the call order of hooks, "modification_date" may come in entity.cw_edited or not (from "metaattrsupdate" hook usually). It should however not be considered in the notification context. Closes #8842064.

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.