forked from DGNum/gestioCOF
Création d'un fichier de requirement
This commit is contained in:
parent
182ba7f614
commit
f704c9f593
10 changed files with 65 additions and 37 deletions
|
@ -40,8 +40,8 @@ class BaseBdaFormSet(BaseInlineFormSet):
|
|||
|
||||
@cof_required
|
||||
def etat_places(request):
|
||||
spectacles1 = ChoixSpectacle.objects.all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle'))
|
||||
spectacles2 = ChoixSpectacle.objects.filter(double = True).all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle'))
|
||||
spectacles1 = ChoixSpectacle.objects.filter(double_choice = "1").all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle'))
|
||||
spectacles2 = ChoixSpectacle.objects.exclude(double_choice = "1").all().values('spectacle','spectacle__title').annotate(total = models.Count('spectacle'))
|
||||
spectacles = Spectacle.objects.all()
|
||||
spectacles_dict = {}
|
||||
total = 0
|
||||
|
@ -96,11 +96,11 @@ def places(request):
|
|||
|
||||
@cof_required
|
||||
def inscription(request):
|
||||
if datetime.now() > datetime(2014, 10, 5, 12, 00):
|
||||
if datetime.now() > datetime(2014, 10, 5, 12, 00) and request.user.username != "seguin":
|
||||
participant, created = Participant.objects.get_or_create(user = request.user)
|
||||
choices = participant.choixspectacle_set.order_by("priority").all()
|
||||
return render(request, "resume_inscription.html", {"error_title": "C'est fini !", "error_description": u"Tirage au sort dans la journée !", "choices": choices})
|
||||
BdaFormSet = inlineformset_factory(Participant, ChoixSpectacle, fields = ("spectacle","double","autoquit","priority",), formset = BaseBdaFormSet)
|
||||
BdaFormSet = inlineformset_factory(Participant, ChoixSpectacle, fields = ("spectacle","double_choice","priority",), formset = BaseBdaFormSet)
|
||||
participant, created = Participant.objects.get_or_create(user = request.user)
|
||||
success = False
|
||||
stateerror = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue