Designing and Implementing a Shopping Cart API - Lesson 5 - Missing part?

Hello friends,

I reached this part of The Ultimate Django Series: Part 2 and could not find the way to solve the excercise by myself, when looking for Mosh’s solution I can’t find how the “GET” for carts was implemented.
Am I missing something?
Where can I find the code?
Thank you for your time!
Regards
Ariel

1 Like

Hello again,
I found my error. It was just a misunderstanding of the proposed excercise.
I was trying to get my cart using a URL like …/carts?=‘cart-uuid’ and that invokes get from CartViewSet which was intendedly NOT implemented.
After careful revision of URLS on the video, using the URL as requested by Mosh could make it work …/carts/‘cart-uuid’
Hope this helps anyone there in the future if stumbled like me.
Cheers!
Ariel

1 Like

hello, I have this problem too, and a still not figure out how can i resolve it, i sent the same request like Mosh did , …/carts/‘cart-uuid , but i still have the same issue “Page not found (404)”,means the GET method is not implemented !!!
any help plz…!!

Hello @Zouhair
I cannot figure out whats happening there without a little help from your side.
1 - could you please attach a screen capture?
2 - could you please share the code you implemented in your models and serializers files?
Thanks for yout time.
Regards
Ariel

Hello @ariel.robaldo

It’s Ok, i fixed it, thank you so much for your reply.
I wish you the best learning.
Best regards

Zouhair

1 Like

I also have the same problem, I can’t get the cart instance page.
Although I write the right url pattern, I’ve searched alot but I couldn’t find the solution

Hello @isra I cannot figure out whats happening there without a little help from your side.
1 - could you please attach a screen capture?
2 - could you please share the code you implemented in your models and serializers files?
3 - perhaps @Zouhair could also share his/her solution
Thanks for yout time.
Regards
Ariel

Edit I’ve solved my bug, I didn’t add (RetrieveModelMixin) to the cart view set :expressionless: so make sure you add this model to the cart view set , see 8:30 of the lesson 5 getting card

Thank you so much @ariel.robaldo I appreciate your reply.

1 Like

@isra it was the same case for me , i forgot add the RetrieveModelMixin to teh cart view :man_facepalming: …best learning.

1 Like