def handle_edit_comment(self, str_new_comment, str_comment_id, str_post_id, str_user_id): if not str_new_comment: return self.render_front(str_user_id, str_post_id, "Your Comment may not be empty") else: # get original comment and adjust comment = Comment.by_id(int(str_comment_id)) comment.text = str_new_comment comment.put() return self.delayed_render_front(str_user_id)
def handle_delete_comment(self, str_comment_id, str_user_id): # get original comment and delete comment = Comment.by_id(int(str_comment_id)) comment.delete() return self.delayed_render_front(str_user_id)