コード例 #1
0
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!")
コード例 #2
0
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!")
コード例 #3
0
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)
コード例 #4
0
 def __init__(self, application, request):
     RHandler.__init__(self, application, request)
     self.commentDao = CommentDao()