Previously, only the number of bookings was shown.
<h1>Overzicht reserveringen</h1>
<table>
<thead>
- <tr><th>Voorstelling</th><th>Reserveringen</th><th>Betaald</th></tr>
+ <tr><th>Voorstelling</th><th>Reserveringen</th><th>Gereserveerde kaarten</th><th>Betaalde kaarten</th></tr>
</thead>
<tbody>
{% for show, info in shows.items %}
-<tr><td>{{ show }}</td><td>{{ info.bookings|length }}</td><td>{{ info.payed|length }}</td></tr>
+<tr><td>{{ show }}</td><td>{{ info.bookings|length }}</td><td>{{ info.tickets }}</td><td>{{ info.payed|length }}</td></tr>
{% endfor %}
</tbody>
</table>
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),
}