def get(self,uid): user_model = UserModel() book_model = BookModel() info = user_model.get_user(uid) current = book_model.get_current(uid) data = {} current_list = [] for book in current: item = {} item["rent_time"] = book[0].date() item["return_time"] = book[1].date() item["title"] = book[2] item["images"] = book[3] item["author"] = book[4] item["isbn"] = book[5] item["address"] = book[6] current_list.append(item) data["current"] = current_list uinfo = {} for user in info: uinfo["name"] = user[0] uinfo["gravator"] = user[1] uinfo["major"] = user[2] uinfo["degree"] = user[3] uinfo["num"] = user[4] uinfo["id"] = user[5] data["uinfo"] = uinfo self.render("user.html",data=data)
def get(self,uid): result = {} book_model = BookModel() user_info = self.get_current_user() current = book_model.get_current(uid) result = {"user":user_info} book_list = [] for book in current: item = {} item["rent_time"] = book[0].date() item["return_time"] = book[1].date() item["title"] = book[2] item["images"] = book[3] item["author"] = book[4] item["isbn"] = book[5] item["address"] = book[6] book_list.append(item) result["book"] = book_list self.render("current.html",data=result)