diff --git a/bda/views.py b/bda/views.py index c1b80189..a14380d8 100644 --- a/bda/views.py +++ b/bda/views.py @@ -25,14 +25,18 @@ from bda.forms import BaseBdaFormSet, TokenForm, ResellForm @cof_required def etat_places(request, tirage_id): tirage = get_object_or_404(Tirage, id=tirage_id) - spectacles1 = ChoixSpectacle.objects.filter(spectacle__tirage=tirage - ).filter(double_choice="1" - ).all().values('spectacle','spectacle__title' - ).annotate(total=models.Count('spectacle')) - spectacles2 = ChoixSpectacle.objects.filter(spectacle__tirage=tirage - ).exclude(double_choice="1" - ).all().values('spectacle','spectacle__title' - ).annotate(total=models.Count('spectacle')) + spectacles1 = ChoixSpectacle.objects \ + .filter(spectacle__tirage=tirage) \ + .filter(double_choice="1") \ + .all() \ + .values('spectacle','spectacle__title') \ + .annotate(total=models.Count('spectacle')) + spectacles2 = ChoixSpectacle.objects \ + .filter(spectacle__tirage=tirage) \ + .exclude(double_choice="1") \ + .all() \ + .values('spectacle','spectacle__title') \ + .annotate(total=models.Count('spectacle')) spectacles = Spectacle.objects.filter(tirage=tirage).all() spectacles_dict = {} total = 0