class UserAdd(RHandler): def __init__(self, application, request): RHandler.__init__(self, application, request) self.userDao = UserDao() def get(self): self.userDao.save({}) self.write("add success!")
class UserDelete(RHandler): def __init__(self, application, request): RHandler.__init__(self, application, request) self.userDao = UserDao() def get(self): user_id = self.get_argument("id", None) self.userDao.deleteByid(user_id) self.write("delete success!")
class UserPageQuery(RHandler): def __init__(self, application, request): RHandler.__init__(self, application, request) self.userDao = UserDao() def get(self): user_id = self.get_argument("user_id", None) user = self.userDao.findByid(user_id) self.render("userDetail.html", user=user)
def __init__(self, application, request): RHandler.__init__(self, application, request) self.userDao = UserDao()