Donne plus d'infos à la vue spectacles

This commit is contained in:
ludo 2016-06-09 13:10:59 +02:00
parent de227efcb0
commit 6cd89da67c

View file

@ -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):