how to get(article.id) in line 273

This commit is contained in:
Ivan Hörler 2018-02-11 16:24:36 +01:00
parent 4f17a85dc7
commit d0217960d3
1 changed files with 5 additions and 1 deletions

View File

@ -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,