Which error are you seeing now? Try making this change and let us know what the 
results are.

        cart_obj, new_obj = Cart.objects.get(user=request.user)
        if product_obj in cart_obj.products.all():
            cart_obj.products.remove(product_obj)
            added = False

Context: 
http://www.learningaboutelectronics.com/Articles/How-to-check-if-an-object-is-in-a-ManyToManyField-in-Django.php

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/2b356801-9f78-4d3d-b10e-39b4d5908dcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to