Donne plus d'infos à la vue spectacles
This commit is contained in:
parent
de227efcb0
commit
6cd89da67c
1 changed files with 11 additions and 1 deletions
12
bda/views.py
12
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):
|
||||
|
|
Loading…
Reference in a new issue