本文整理汇总了Python中model.Comment.del_comment_by_id方法的典型用法代码示例。如果您正苦于以下问题:Python Comment.del_comment_by_id方法的具体用法?Python Comment.del_comment_by_id怎么用?Python Comment.del_comment_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Comment
的用法示例。
在下文中一共展示了Comment.del_comment_by_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from model import Comment [as 别名]
# 或者: from model.Comment import del_comment_by_id [as 别名]
def get(self, id = ''):
obj = None
if id:
obj = Comment.get_comment_by_id(id)
if obj:
act = self.get_argument("act",'')
if act == 'del':
Comment.del_comment_by_id(id)
clear_cache_by_pathlist(['post:%d'%obj.postid])
self.redirect('%s/admin/comment/'% (BASE_URL))
return
self.echo('admin_comment.html', {
'title': "管理评论",
'cats': Category.get_all_cat_name(),
'tags': Tag.get_all_tag_name(),
'obj': obj,
'comments': Comment.get_recent_comments(),
},layout='_layout_admin.html')
示例2: get
# 需要导入模块: from model import Comment [as 别名]
# 或者: from model.Comment import del_comment_by_id [as 别名]
def get(self, id=""):
obj = None
if id:
obj = Comment.get_comment_by_id(id)
if obj:
act = self.get_argument("act", "")
if act == "del":
Comment.del_comment_by_id(id)
if MYSQL_TO_KVDB_SUPPORT:
clear_cache_by_pathlist(["post:%d" % obj["postid"]])
else:
clear_cache_by_pathlist(["post:%d" % obj.postid])
self.redirect("%s/admin/comment/" % (BASE_URL))
return
self.echo(
"admin_comment.html",
{"title": "管理评论", "obj": obj, "comments": Comment.get_recent_comments(ADMIN_RECENT_COMMENT_NUM)},
layout="_layout_admin.html",
)
示例3: get
# 需要导入模块: from model import Comment [as 别名]
# 或者: from model.Comment import del_comment_by_id [as 别名]
def get(self, id=""):
obj = None
if id:
obj = Comment.get_comment_by_id(id)
if obj:
act = self.get_argument("act", "")
if act == "del":
Comment.del_comment_by_id(id)
clear_cache_by_pathlist(["post:%d" % obj.postid])
self.redirect("%s/admin/comment/" % (BASE_URL))
return
self.echo(
"admin_comment.html",
{
"title": "管理评论",
"cats": Category.get_all_cat_name(),
"tags": Tag.get_all_tag_name(),
"obj": obj,
"comments": Comment.get_recent_comments(),
},
layout="_layout_admin.html",
)