def post(self, postID, commentID):
key = db.Key.from_path('Post', int(postID), parent = blog_key())
post = db.get(key)
if self.request.get("save"):
comment = Comments.get_by_id(int(commentID))
if self.user and comment:
comment = Comments.get_by_id(int(commentID))
if comment.author.name == self.user.name:
comment.content = self.request.get("content")
comment.put()
time.sleep(0.2)
self.redirect("/blog/%s" % str(post.key().id()))
else:
save_error = "Only the author of the comment can make changes."
self.render("editcomment.html", comment = comment, save_error = save_error)
if self.request.get("cancel"):
self.redirect("/blog/%s" % str(post.key().id()))
评论列表
文章目录