it all is not working, i guess i have to write another independent function
for reomving products from the cart
but thx. though i thought, it would workout

On Sat, Jun 22, 2019 at 9:00 PM Alejandro Pena <adp...@gmail.com> wrote:

> 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.
>

-- 
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/CAMz%3Dh%3DRqw6k_wopSy2pJCFLx-yLbwbyDLvCeWiiUpGHUTWEb4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to