From d0217960d3c1beccf76c278af3aa2351d5251f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ho=CC=88rler?= Date: Sun, 11 Feb 2018 16:24:36 +0100 Subject: [PATCH] how to get(article.id) in line 273 --- django/didgeridoo/webshop/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/didgeridoo/webshop/views.py b/django/didgeridoo/webshop/views.py index 8ca0986..7018f9a 100644 --- a/django/didgeridoo/webshop/views.py +++ b/django/didgeridoo/webshop/views.py @@ -265,10 +265,14 @@ def cart(request): article.price_in_chf = rate.exchange( currency, article.price_in_chf) - total += article.price_in_chf else: articles = CartPosition.objects.filter(cart=cart_id) articles_list = list(articles) + for idx, article in enumerate(articles_list): + articles_list[idx] = article + article.price_in_chf = CartPosition.objects.get(article.article.id) + + total += article.price_in_chf return render(request, 'webshop/cart.html', {'articles_list': articles_list,