Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @require_POST
- def cart_add(request, book_id):
- cart = Cart(request)
- book = get_object_or_404(Book, id=book_id)
- form = CartAddProductForm(request.POST)
- if form.is_valid():
- cd = form.cleaned_data
- cart.add(book=book, quantity=cd['quantity'], update_quantity=cd['update'])
- return redirect('cart:cart_detail')
Advertisement
Add Comment
Please, Sign In to add comment