コード例 #1
0
ファイル: files.py プロジェクト: mohalfaki/bungeni-portal
def fileAddedSubscriber(ob, event):
    """ when a file is added notify the object it is added to """
    ob = removeSecurityProxy(ob)
    obj = audit.getAuditableParent(ob)
    if obj:
        event.description = u"File %s %s added" % (ob.file_title, ob.file_name)
        notify(audit.objectAttachment(obj, event))
コード例 #2
0
ファイル: files.py プロジェクト: BenoitTalbot/bungeni-portal
def fileEditedSubscriber(ob, event):
    """ when a file is edited notify the parent object """
    ob = removeSecurityProxy(ob)
    obj = audit.getAuditableParent(ob)
    if obj:
        event.description = u"File %s %s edited" % (ob.file_title, ob.file_name)
        notify(audit.objectAttachment(obj, event))