本文整理汇总了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})
示例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())