+ 2
Show Orderitems based on Order Id.
I doing an ecommerce django website project. I have created six models Category, Product, Customer, Order, OrderItems and OrderSummary. When each time a new customer order items, OrderItems object are created in admin page. My problem here is Object OrderItems is created on each items that customer choose regardless of Order Id, I.e, when a customer choose more than one item at time that much object where created. I need to get single OrderItems object of a particular order id that have morethan one item that customer ordered. What can I do? Or is there is any possibility to filter an Order items based on a order Id that can be done within that model.py or Admin.py file? Plz help?
4 Answers
+ 3
Can you please provide any learnig link to let me know how to query and run analysis đ
+ 2
Okay
+ 1
Yah...using sqlite
I am little bit beginner, and my first attempt to do a project
+ 1
To work this out you have to create a model called Order and pass it as ForeignKey to another model that should be item.
Like This đ
https://code.sololearn.com/cMh04t3g5sj3/?ref=app