From a070b7e97decc30fe1d648ab49dfe5eb57ef76a2 Mon Sep 17 00:00:00 2001 From: koksnuss Date: Tue, 28 Apr 2020 21:17:30 +0200 Subject: [PATCH] wip --- coinmanager/coinc/views.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/coinmanager/coinc/views.py b/coinmanager/coinc/views.py index 69d00ce..2c532dd 100644 --- a/coinmanager/coinc/views.py +++ b/coinmanager/coinc/views.py @@ -25,7 +25,7 @@ from django.template import loader from django.template.defaultfilters import register from django.views import generic -from .models import Country, Stamp +from .models import Country, Stamp, Coin @@ -50,16 +50,6 @@ def show_navigation(countrys): return {'countrys': countrys} -@register.filter(name='coins') -def coins(country, year): - return country['years'][year] - - -@register.inclusion_tag('coinc/year.html') -def show_year(country, year): - return { 'year': country['years'][year], - 'year_int': year } - @register.inclusion_tag('coinc/country.html') def show_country(country): @@ -71,7 +61,12 @@ def show_country(country): } irregular_stamps = {} - stamps = Stamp.objects.filter(country=country.name_iso).values('name_short', 'years') + stamps = Stamp.objects.filter(country=country.name_iso).values( + 'name_short', 'years') + coins = Coin.objects.filter(country=country.name_iso).values( + 'value', 'year', 'stamp', 'name', 'found_by', + 'found_on', 'buy_only', 'circulation', 'comment', + 'in_collector', 'checked', 'exists') if stamps: temp_stamps = {} @@ -110,5 +105,13 @@ def show_country(country): return {'country': c} + +@register.inclusion_tag('coinc/year.html') +def show_year(country, year): + return { 'year': country['years'][year], + 'year_int': year } + + +# TODO def statistic(request): return HttpResponse('Statistik')