From 02d8f6dc92f570d1016c139b0ec0fb742fe66d7b Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 25 Oct 2010 11:17:41 +0200 Subject: [PATCH] tickets: List number of booked tickets in the overview. Previously, only the number of bookings was shown. --- tickets/templates/tickets/bookings.html | 4 ++-- tickets/views.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tickets/templates/tickets/bookings.html b/tickets/templates/tickets/bookings.html index ae2d6a9..26d0018 100644 --- a/tickets/templates/tickets/bookings.html +++ b/tickets/templates/tickets/bookings.html @@ -4,11 +4,11 @@

Overzicht reserveringen

- + {% for show, info in shows.items %} - + {% endfor %}
VoorstellingReserveringenBetaald
VoorstellingReserveringenGereserveerde kaartenBetaalde kaarten
{{ show }}{{ info.bookings|length }}{{ info.payed|length }}
{{ show }}{{ info.bookings|length }}{{ info.tickets }}{{ info.payed|length }}
diff --git a/tickets/views.py b/tickets/views.py index 4eca48d..db988fe 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -132,8 +132,10 @@ def payments(request): def bookings(request): shows = {} for (show, show_desc) in SHOW_CHOICES: + bookings = Booking.objects.filter(show=show) shows[show_desc] = { - 'bookings' : Booking.objects.filter(show=show), + 'bookings' : bookings, + 'tickets' : sum([b.tickets for b in bookings]), 'payed' : Booking.objects.filter(show=show, payment__isnull=False), } -- 2.30.2