The order_details view currently shows all orders if we give the id in the url.
But from now on, the orders have to only be the current session orders (sorted by date obviously).
This means in the order_details view where you get the id, it will be the index of the order that is stored in the session:
example:
session["orders"] = [5,12,54]
url: /order/1
this must show the order with id of 12 as 12 is the first index of session["orders"]
if the id given in the url goes further than the urrent session orders list, http 404 must be raised
The
order_details
view currently shows all orders if we give theid
in the url.But from now on, the orders have to only be the current session orders (sorted by date obviously).
This means in the order_details view where you get the
id
, it will be the index of the order that is stored in the session: example: session["orders"] = [5,12,54] url: /order/1 this must show the order with id of 12 as 12 is the first index ofsession["orders"]
if the id given in the url goes further than the urrent session orders list, http 404 must be raised