I would like to retrieve the product whose 'id' is passed as a parameter, how do I do this? For example here I passed the id equal to 1 Note I don't use a model but a dictionary
def cart_add(request, id):
dico={"produits":[{'id':1,'name':'pomme de terre','price':1250}]}
mes_produits=dico['produits']
cart = Cart(request)
mes_produits['id']=id
product=mes_produits['id']
cart.add(product=product)
return render(request, 'cart/cart_detail.html')
i get this error : list indices must be integers or slices, not str