From 6cd89da67c5ec29090728f48d476da99dd8283f0 Mon Sep 17 00:00:00 2001 From: ludo Date: Thu, 9 Jun 2016 13:10:59 +0200 Subject: [PATCH] =?UTF-8?q?Donne=20plus=20d'infos=20=C3=A0=20la=20vue=20sp?= =?UTF-8?q?ectacles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/views.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bda/views.py b/bda/views.py index f4495f55..2161b682 100644 --- a/bda/views.py +++ b/bda/views.py @@ -306,7 +306,17 @@ def revente(request, tirage_id): def spectacle(request, tirage_id, spectacle_id): tirage = get_object_or_404(Tirage, id=tirage_id) spectacle = get_object_or_404(Spectacle, id = spectacle_id, tirage=tirage) - return render(request, "bda-emails.html", {"spectacle": spectacle}) + attributions = spectacle.attribues.all() + participants = [] + for attrib in attributions: + participant = attrib.participant + if (participant in participants): + participant.nb_places = 2 + else: + participant.nb_places = 1 + participants.append(participant) + + return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants}) class SpectacleListView(ListView):