本文整理汇总了Python中vilya.models.project.CodeDoubanProject.del_watch方法的典型用法代码示例。如果您正苦于以下问题:Python CodeDoubanProject.del_watch方法的具体用法?Python CodeDoubanProject.del_watch怎么用?Python CodeDoubanProject.del_watch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.project.CodeDoubanProject
的用法示例。
在下文中一共展示了CodeDoubanProject.del_watch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unwatch
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import del_watch [as 别名]
def unwatch(request):
user = request.user
if not user:
return request.redirect("/")
errors = ""
if request.method == "POST":
proj_id = request.get_form_var('proj_id')
CodeDoubanProject.del_watch(proj_id, user.name)
project = CodeDoubanProject.get(proj_id)
return request.redirect('/%s/' % project.name)
proj_id = request.get_form_var('proj_id') or ""
project = CodeDoubanProject.get(proj_id)
action = "unwatch"
return st('watch.html', **locals())
示例2: remove
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import del_watch [as 别名]
def remove(request, proj_id):
user = request.user
CodeDoubanProject.del_watch(proj_id, user.name)
return json.dumps({"ok": 1})