diff --git a/coinmanager/coinc/templates/coinc/index.html b/coinmanager/coinc/templates/coinc/index.html index 6655410..1ed9d8c 100644 --- a/coinmanager/coinc/templates/coinc/index.html +++ b/coinmanager/coinc/templates/coinc/index.html @@ -3,12 +3,12 @@
{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € {{ coin.year }}{% if coin.stamp %}-{{ coin.stamp }}{% endif %}{% if coin.name %} "{{ coin.name }}"{% endif %} aus {{ coin.country}} von {{ coin.found_by }}
+ {% endfor %} +{{ coin.found_on|date:"d.m.Y" }}: {{ coin.value|floatformat:2 }} € {{ coin.year }}{% if coin.stamp %}-{{ coin.stamp }}{% endif %}{% if coin.name %} "{{ coin.name }}"{% endif %} aus {{ coin.country}} von {{ coin.found_by }}
- {% endif %} - {% endif %} {% endfor %} {% else %}Trage zuerst Länder im Adminbereich ein.
diff --git a/coinmanager/coinc/views.py b/coinmanager/coinc/views.py index d4125e5..0f80173 100644 --- a/coinmanager/coinc/views.py +++ b/coinmanager/coinc/views.py @@ -40,14 +40,21 @@ def index(request): countrys = Country.objects.order_by('name') users = User.objects.order_by('id') coin_sum = total_coin_sum() - recent_coins = Coin.objects.order_by('-found_on')[:10] - for coin in range(len(recent_coins)): - recent_coins[coin].value /= 100 + found_coins = Coin.objects.order_by('-found_on').exclude( + exists=False).exclude( + found_by__exact=None)[:10] + checked_coins = Coin.objects.order_by('-date_modified').filter( + checked=True)[:10] + for coin in range(len(found_coins)): + found_coins[coin].value /= 100 + for coin in range(len(checked_coins)): + checked_coins[coin].value /= 100 context = { 'countrys': countrys, 'users': users, 'coin_sum': f'{coin_sum:.2f} €', - 'recent_coins': recent_coins, + 'found_coins': found_coins, + 'checked_coins': checked_coins } return HttpResponse(template.render(context, request))