From: Matthijs Kooijman Date: Wed, 3 Nov 2010 13:04:10 +0000 (+0100) Subject: tickets: Show number of payed tickets instead of reservations. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=8f82b787420a65cb08b42b59dea1929c76b77be4;p=matthijs%2Fprojects%2Fdorestad-bookings.git tickets: Show number of payed tickets instead of reservations. The table header already said "payed tickets", but the number reflected the number of payed reservations, which isn't quite as useful. --- diff --git a/tickets/templates/tickets/bookings.html b/tickets/templates/tickets/bookings.html index 0c0348d..787067b 100644 --- a/tickets/templates/tickets/bookings.html +++ b/tickets/templates/tickets/bookings.html @@ -8,7 +8,7 @@ {% for show, info in shows %} -{{ show }}{{ info.bookings|length }}{{ info.tickets }}{{ info.payed|length }} +{{ show }}{{ info.bookings|length }}{{ info.tickets }}{{ info.payed }} {% endfor %} diff --git a/tickets/views.py b/tickets/views.py index 5b7ab75..1764301 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -137,7 +137,7 @@ def bookings(request): shows.append((show_desc, { 'bookings' : bookings, 'tickets' : sum([b.tickets for b in bookings]), - 'payed' : Booking.objects.filter(show=show, payment__isnull=False), + 'payed' : sum([b.tickets for b in bookings if b.payment is not None]), })) c = { 'shows' : shows }