Hi Folks,

I'm getting this error "TypeError:" everytime, Can You guys tell me where
is the problem in this code.

*Cart*

views.py
@require_POST
def cart_add(request,product_id):
cart = Cart(request)
product = get_object_or_404(Product,id  = product_id)
form = forms.CartAddProductForm(request.POST)
if form.is_valid():
cd  = form.cleaned_data
cart.add(
       product = product,
       quantity = cd['quantity'],
       update_quantity = cd['update'])
return redirect('cart:cart_detail')


def cart_detail(request):
cart = Cart(request)
return render (request,'cart/cartdetail.html',{'cart':cart})



cartdetail.html:
{% for item in cart %}
{{ item.quantity }}
{% endfor %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WYVTQWq-5WtiMo6HekSmaw6%2BRCxfRu4wbFF9BgYaDsPqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to