def my_wish(): uid = current_user.id wishes_of_mine = Wish.get_user_wishes(uid) isbn_list = [wish.isbn for wish in wishes_of_mine] gift_count_list = Wish.get_gift_counts(isbn_list) view_model = MyWishes(wishes_of_mine, gift_count_list) return render_template('my_wish.html', wishes=view_model.gifts)
def my_wish(): uid = current_user.id wishes_of_mine = Wish.get_user_wishes(uid) isbn_list = [gift.isbn for gift in wishes_of_mine] # 每个礼物对应的心愿数量 gift_count_list = Wish.get_gifts_counts(isbn_list) view_Model = MyTrades(wishes_of_mine, gift_count_list) return render_template('my_wish.html', wishes=view_Model.trades)