本文整理汇总了Python中model.Comment.update_comment_edit方法的典型用法代码示例。如果您正苦于以下问题:Python Comment.update_comment_edit方法的具体用法?Python Comment.update_comment_edit怎么用?Python Comment.update_comment_edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Comment
的用法示例。
在下文中一共展示了Comment.update_comment_edit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from model import Comment [as 别名]
# 或者: from model.Comment import update_comment_edit [as 别名]
def post(self, id=""):
act = self.get_argument("act", "")
if act == "findid":
eid = self.get_argument("id", "")
self.redirect("%s/admin/comment/%s" % (BASE_URL, eid))
return
tf = {"true": 1, "false": 0}
post_dic = {
"author": self.get_argument("author"),
"email": self.get_argument("email", ""),
"content": safe_encode(self.get_argument("content").replace("\r", "\n")),
"url": self.get_argument("url", ""),
"visible": self.get_argument("visible", "false"),
"id": id,
}
post_dic["visible"] = tf[post_dic["visible"].lower()]
if MYSQL_TO_KVDB_SUPPORT:
obj = Comment.get_comment_by_id(id)
for k, v in obj.items():
if k not in post_dic:
post_dic[k] = v
Comment.update_comment_edit(post_dic)
clear_cache_by_pathlist(["post:%s" % id])
self.redirect("%s/admin/comment/%s" % (BASE_URL, id))
return
示例2: post
# 需要导入模块: from model import Comment [as 别名]
# 或者: from model.Comment import update_comment_edit [as 别名]
def post(self, id = ''):
act = self.get_argument("act",'')
if act == 'findid':
eid = self.get_argument("id",'')
self.redirect('%s/admin/comment/%s'% (BASE_URL, eid))
return
tf = {'true':1,'false':0}
post_dic = {
'author': self.get_argument("author"),
'email': self.get_argument("email"),
'content': safe_encode(self.get_argument("content").replace('\r','\n')),
'url': self.get_argument("url",''),
'visible': self.get_argument("visible",'false'),
'id': id
}
post_dic['visible'] = tf[post_dic['visible'].lower()]
Comment.update_comment_edit(post_dic)
clear_cache_by_pathlist(['post:%s'%id])
self.redirect('%s/admin/comment/%s'% (BASE_URL, id))
return
示例3: post
# 需要导入模块: from model import Comment [as 别名]
# 或者: from model.Comment import update_comment_edit [as 别名]
def post(self, id=""):
act = self.get_argument("act", "")
if act == "findid":
eid = self.get_argument("id", "")
self.redirect("%s/admin/comment/%s" % (BASE_URL, eid))
return
tf = {"true": 1, "false": 0}
post_dic = {
"author": self.get_argument("author"),
"email": self.get_argument("email"),
"content": safe_encode(self.get_argument("content").replace("\r", "\n")),
"url": self.get_argument("url", ""),
"visible": self.get_argument("visible", "false"),
"id": id,
}
post_dic["visible"] = tf[post_dic["visible"].lower()]
Comment.update_comment_edit(post_dic)
clear_cache_by_pathlist(["post:%s" % id])
self.redirect("%s/admin/comment/%s" % (BASE_URL, id))
return