Fix graph layout

This commit is contained in:
Kevin Alberts 2019-11-12 13:58:30 +01:00
parent 504a9f6515
commit 93cb146eb3
Signed by: Kurocon
GPG key ID: BCD496FEBA0C6BC1
3 changed files with 14 additions and 4 deletions

View file

@ -32,6 +32,7 @@ class HomePage(CreateView):
dates = Kwijtgeraakt.objects.all().order_by('date')
context['tapperlist'] = [x.name for x in Tapper.objects.all()]
context['datelist'] = [x.date.strftime("%Y-%m-%d") for x in dates]
context['tappersdata'] = {}
current_counts = {tapper.name: 0 for tapper in Tapper.objects.all()}
for date in dates:
@ -59,9 +60,12 @@ class DetailPage(FormView):
context['tappers'] = Tapper.objects.all().annotate(amount=Count('kwijtgeraakt'))
context['detailform'] = form
context['start_date'] = form.cleaned_data['start_date']
context['end_date'] = form.cleaned_data['end_date']
dates = Kwijtgeraakt.objects.filter(date__gte=form.cleaned_data['start_date'], date__lte=form.cleaned_data['end_date']).order_by('date')
context['tapperlist'] = [x.name for x in Tapper.objects.all()]
context['datelist'] = [x.date.strftime("%Y-%m-%d") for x in dates]
context['tappersdata'] = {}
current_counts = {tapper.name: 0 for tapper in Tapper.objects.all()}
for date in dates: