示例#1
0
def cart_add(pet_id):
    cart = get_cart()
    pet = find_pet(pet_id)
    cart.append(pet)
    new_cart = {'pets_in_cart': cart}
    save_cart(new_cart)
    return redirect(url_for('cart'))
示例#2
0
def add_pet_to_cart(pet_id):
    cart = get_cart()
    pet = find_pet(pet_id)
    if pet is not None:
        cart['pets'].append(pet)
        save_cart(cart)
    return redirect(url_for('show_cart'))
示例#3
0
def add_to_cart(id):
    pet = find_pet(id)
    cart = get_cart()
    if pet is not None:
        cart.append(pet)
    save_cart(cart)
    return redirect(url_for("show_cart"))
示例#4
0
def add_pet(pet_id):
    pet = find_pet(pet_id)
    cart = get_cart()
    cart.append(pet)
    new_cart = {"pets_in_cart": cart}
    save_cart(new_cart)
    return redirect(url_for('cart'))
示例#5
0
def show_pet(pet_id):
    pet = find_pet(pet_id)
    return render_template('pet.html', pet=pet)
示例#6
0
def pet(id):
    pet = find_pet(id)
    return render_template('pet.html', pet=pet)
示例#7
0
def show_pet(id):
    #This is the cup that catches the juice
    pet = find_pet(id)
    return render_template('pet.html', pet=pet)