Closed armsmani closed 8 years ago
Hi and thanks for your comment. Concerning the error you've mentioned: 'list' object has no attribute 'filter'. It's usually because a Python List object is found where we expected Django Queryset object.
I'm not sure if you've customized things on your end.
Cart
retrieves the products from the get_queryset()
method. Usually the statement looks like: Product.objects.all()
.When you create an instance of the Cart
we apply a filter on top of the the result of get_queryset()
:
# In Cart.__init__()
self.get_queryset().filter(pk__in=ids_in_cart)
That's the statement that caused an error.
May be on you end, the get_queryset()
method returns a List object instead of a Queryset object.
I hope these explanation helps troubleshooting. I'm happy to assist more if you need.
Thanks.
I'm closing this issue for now. Let's reopen if the problem comes back.
I was tried to add multiple items in cart but its throwing below errors. Attribute error: 'list' object has no attribute 'filter'. line number: 50 in cart.py
How can i resolve this issues?