class CommentAdd(RHandler): def __init__(self, application, request): RHandler.__init__(self, application, request) self.commentDao = CommentDao() def get(self): self.commentDao.save({}) self.write("add success!")
class CommentDelete(RHandler): def __init__(self, application, request): RHandler.__init__(self, application, request) self.commentDao = CommentDao() def get(self): comment_id = self.get_argument("id", None) self.commentDao.deleteByid(int(comment_id)) self.write("delete success!")
class CommentPageQuery(RHandler): def __init__(self, application, request): RHandler.__init__(self, application, request) self.commentDao = CommentDao() def get(self): comment_id = self.get_argument("comment_id", None) comment = self.commentDao.findByid(comment_id) self.render("commentDetail.html", comment=comment)
def __init__(self, application, request): RHandler.__init__(self, application, request) self.commentDao = CommentDao()