def GET(self, id): self.login_required() if not id: return "the id is empty!<br/>" try: id = int(id) except: return "the id is invalid!<br/>" #判断书id是否正确 b = model.ifhasbook(id) if b == 0: return "the book(%d) not exist!<br />" % id model.delete_feed(id) raise web.seeother('/my')
def GET(self,id): self.login_required() if not id: return "the id is empty!<br/>" try: id = int(id) except: return "the id is invalid!<br/>" #判断书id是否正确 b = model.ifhasbook(id) if b == 0: return "the book(%d) not exist!<br />" % id model.delete_feed(id) raise web.seeother('/my')
def GET(self, id): self.login_required() if not id: return "the id is empty!<br />" try: id = int(id) except: return "the id is invalid!<br />" #判断书id是否正确 b = model.ifhasbook(id) if b == 0: return "the book(%d) not exist!<br />" % id #订阅(判断是否已经订阅) user = self.getcurrentuser() model.put_subscribe(user.k_id, id) raise web.seeother('/my')
def GET(self, id): self.login_required() if not id: return "the id is empty!<br />" try: id = int(id) except: return "the id is invalid!<br />" #判断书id是否正确 b = model.ifhasbook(id) if b == 0: return "the book(%d) not exist!<br />" % id #订阅(判断是否已经订阅) user = self.getcurrentuser() model.put_subscribe(user.k_id,id) raise web.seeother('/my')