跳转到主要内容

类似于 nosylist 组件的 CubicWeb 框架的 roundup

项目描述

摘要

此立方体提供类似于 nosy-list 的“roundup”,可用于通知用户其订阅的事件,例如内容修改、状态更改等。

Nosy list 是一种临时的邮件列表,用户可以注册或自动注册某些操作。

用法

要使用此立方体

  1. 将其添加到您的模式中

    CWUser interested_in X
    X nosy_list CWUser

    其中 X 是作为通知基础的实体类型,例如控制哪些人将收到与 X 相关的事件通知。

  2. 配置应传播 nosy list 的关系

    from cubes.nosylist import hooks as nosylist_hooks
    
    # relations where the "main" entity (eg holding the reference nosy list, so
    # should be in one `X` types cited above) is the subject of the relation
    nosylist_hooks.S_RELS |= set(('documented_by', 'attachment', 'screenshot'))
    
    # relations where the "main" entity (eg holding the reference nosy list, so
    # should be in one `X` types cited above) is the object of the relation
    nosylist_hooks.O_RELS |= set(('for_version', 'comments'))
  3. 编写钩子,在需要时将用户添加到 nosy list 中(例如,当用户向实体添加评论时,将其添加到实体的 nosy list 中)

  4. 定义您的通知视图/钩子,应依赖于默认的接收者查找机制来获取通知用户(如果使用 CubicWeb 基类,则为自动)

项目详情


下载文件

下载适合您的平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

cubicweb-nosylist-1.0.0.tar.gz (14.1 kB 查看哈希值)

上传时间 源代码

构建版本

cubicweb_nosylist-1.0.0-py3-none-any.whl (15.9 kB 查看哈希值)

上传时间 Python 3

由以下支持