Tuesday, June 1, 2021

Re: In immediate help of a long time pending request, kindly help.

Right, thank you so much.

Regards.

On Tue, 1 Jun, 2021, 8:27 pm oba stephen, <obastepheno@gmail.com> wrote:
You should return this if you want to redirect to cart; 

return redirect(reverse("store:cart-page", kwargs={"id": <the ID of the cart>}))

Best regards

Stephen Oba

On Tue, Jun 1, 2021, 3:27 PM Aritra Ray <aritra805@gmail.com> wrote:
Sure, here's the file.



Regards, 
Aritra.

On Tue, 1 Jun 2021 at 19:45, oba stephen <obastepheno@gmail.com> wrote:
Can I see your urls.py?

Best regards

Stephen Oba

On Tue, Jun 1, 2021, 3:05 PM Aritra Ray <aritra805@gmail.com> wrote:
Oh, okay. I was unaware of that. Although, my cart page is getting redirected back to home page. Can you spot any mistake in the provided screenshots? 
Also, can you please guide on how to redirect a function to the previously visited page? Like add-to-cart should redirect to either products page or cart page itself depending on which page the user called it from.

On Tue, 1 Jun, 2021, 6:37 pm oba stephen, <obastepheno@gmail.com> wrote:
Hi,

I don't think you have an error here. Although I haven't looked at the code, but from your django admin page I can see that none of those items are selected. 

If you run a query from your terminal, you would notice that the items would return as empty. 

When you create a many to many relationship in django, all objects on that related model would display this way. 

What is the difference between different carts?  The difference is, the items would be selected or highlighted in a cart they belong to. 

Regards 

Best regards

Stephen Oba

On Tue, Jun 1, 2021, 1:52 PM Aritra Ray <aritra805@gmail.com> wrote:

Hello, 
This is Aritra reposting the same error. I have a problem regarding an E-commerce Django website where the cart model on the admin page is showing the items added to cart by one user to all other users as well. 
I have a Profile model and a Cart model attached below. The views.py has been attached too. Kindly comment back if anything else is needed. 
Thanks in advance.


Regards,
Aritra

Error:


Views.py


Models.py 


--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFecadtNZeLbatpdnuC_RUDdjLjbrvZTO%2BMVD7hPuHNkN%2Bv%2BBA%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAJsLnpYBVfacxd3NJ7sqnC6dD2b6nBQw%3DFqfQe9Od1%2BpwTHww%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFecadvZ11v-bvZzCXUVUTpr0WBa6eVmF7M6qpoVRFNF5dS%2Bcg%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAJsLnqwLQNwKExW23UW%3DgiF_co-rZ1adHcSmx6ZUSg4rDp61w%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFecaduG3p6QS%2BxdGv%2B6zi4jH_x%2BQPm%3D0TjoKjb2K8-pHc6%3DEw%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAJsLnoFZZegG9bmvMLCmxhp%2B%3D6%3DnoaajxJ1m%2Ba8LXAP%2Bhk%2B9Q%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFecadtUShE1Hn_jVasfJ3sU24ctaT4YqVBHRw4T_fWn1nW08Q%40mail.gmail.com.

No comments:

Post a Comment