本文整理汇总了Python中tracim.lib.content.ContentApi.do_notify方法的典型用法代码示例。如果您正苦于以下问题:Python ContentApi.do_notify方法的具体用法?Python ContentApi.do_notify怎么用?Python ContentApi.do_notify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tracim.lib.content.ContentApi
的用法示例。
在下文中一共展示了ContentApi.do_notify方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from tracim.lib.content import ContentApi [as 别名]
# 或者: from tracim.lib.content.ContentApi import do_notify [as 别名]
def post(self, label='', content='', parent_id=None):
"""
Creates a new thread. Actually, on POST, the content will be included in a user comment instead of being the thread description
:param label:
:param content:
:return:
"""
# TODO - SECURE THIS
workspace = tmpl_context.workspace
api = ContentApi(tmpl_context.current_user)
thread = api.create(ContentType.Thread, workspace, tmpl_context.folder, label)
# FIXME - DO NOT DUPLCIATE FIRST MESSAGE thread.description = content
api.save(thread, ActionDescription.CREATION, do_notify=False)
comment = api.create(ContentType.Comment, workspace, thread, label)
comment.label = ''
comment.description = content
api.save(comment, ActionDescription.COMMENT, do_notify=False)
api.do_notify(thread)
tg.flash(_('Thread created'), CST.STATUS_OK)
tg.redirect(self._std_url.format(tmpl_context.workspace_id, tmpl_context.folder_id, thread.content_id))