当前位置: 首页>>代码示例>>Python>>正文


Python QuestionSolvedEvent.stop_notifying方法代码示例

本文整理汇总了Python中questions.events.QuestionSolvedEvent.stop_notifying方法的典型用法代码示例。如果您正苦于以下问题:Python QuestionSolvedEvent.stop_notifying方法的具体用法?Python QuestionSolvedEvent.stop_notifying怎么用?Python QuestionSolvedEvent.stop_notifying使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在questions.events.QuestionSolvedEvent的用法示例。


在下文中一共展示了QuestionSolvedEvent.stop_notifying方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: unsubscribe_watch

# 需要导入模块: from questions.events import QuestionSolvedEvent [as 别名]
# 或者: from questions.events.QuestionSolvedEvent import stop_notifying [as 别名]
def unsubscribe_watch(request, watch_id, secret):
    """Stop watching a question, for anonymous users."""
    watch = get_object_or_404(Watch, pk=watch_id)
    question = watch.content_object
    success = False
    if watch.secret == secret and isinstance(question, Question):
        user_or_email = watch.user or watch.email
        QuestionReplyEvent.stop_notifying(user_or_email, question)
        QuestionSolvedEvent.stop_notifying(user_or_email, question)
        success = True

    return jingo.render(request, "questions/unsubscribe_watch.html", {"question": question, "success": success})
开发者ID:fox2mike,项目名称:kitsune,代码行数:14,代码来源:views.py

示例2: unwatch_question

# 需要导入模块: from questions.events import QuestionSolvedEvent [as 别名]
# 或者: from questions.events.QuestionSolvedEvent import stop_notifying [as 别名]
def unwatch_question(request, question_id):
    """Stop watching a question."""
    question = get_object_or_404(Question, pk=question_id)
    QuestionReplyEvent.stop_notifying(request.user, question)
    QuestionSolvedEvent.stop_notifying(request.user, question)
    return HttpResponseRedirect(question.get_absolute_url())
开发者ID:victorneo,项目名称:kitsune,代码行数:8,代码来源:views.py


注:本文中的questions.events.QuestionSolvedEvent.stop_notifying方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。