Esempio n. 1
0
def my_gifts():
    uid = current_user.id
    gifts_of_mine = Gift.get_user_gift(uid)
    isbn_list = [gift.isbn for gift in gifts_of_mine]
    wish_count_list = Gift.get_wish_count(isbn_list)
    view_gifts = MyGifts(gifts_of_mine, wish_count_list)
    return render_template('my_gifts.html', gifts=view_gifts.gifts)
Esempio n. 2
0
def my_gifts():
    uid = current_user.id
    gifts_of_mine = Gift.get_user_gift(uid)
    isbn_list = [gift.isbn for gift in gifts_of_mine]
    wish_count_list = Gift.get_wish_counts(isbn_list)
    view_model = MyTrades(gifts_of_mine, wish_count_list)
    return render_template("my_gifts.html", gifts=view_model.trades)
Esempio n. 3
0
def my_gifts():
    '''
    赠送清单: 将赠送清单gift要保存的信息保存
            1 用户id
            2 礼物数据(赠送的书籍列表)
            3 心愿数据(想要获取人数)
    :return:
    '''
    uid = current_user.id
    gifts_of_mine = Gift.get_user_gift(uid)
    isbn_list = [gift.isbn for gift in gifts_of_mine]
    wish_count_list = Gift.get_wish_count(isbn_list)
    view_model = MyGifts(gifts_of_mine, wish_count_list)
    return render_template('my_gifts.html', gifts=view_model.gifts)