Nettoyage du code

This commit is contained in:
Martin Pépin 2016-06-06 11:11:33 +02:00
parent ad145ec70f
commit 366daf7240

View file

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