forked from DGNum/gestioCOF
Fixes and cleanup
This commit is contained in:
parent
18b186929c
commit
ba88b94320
3 changed files with 98 additions and 70 deletions
|
@ -10,6 +10,7 @@ from django.contrib.auth.models import User
|
|||
|
||||
from gestioncof.management.base import MyBaseCommand
|
||||
from bda.models import Tirage, Spectacle, Salle, Participant, ChoixSpectacle
|
||||
from bda.views import do_tirage
|
||||
|
||||
|
||||
# Où sont stockés les fichiers json
|
||||
|
@ -30,12 +31,14 @@ class Command(MyBaseCommand):
|
|||
Tirage(
|
||||
title="Tirage de test 1",
|
||||
ouverture=timezone.now()-timezone.timedelta(days=7),
|
||||
fermeture=timezone.now()
|
||||
fermeture=timezone.now(),
|
||||
active=True
|
||||
),
|
||||
Tirage(
|
||||
title="Tirage de test 2",
|
||||
ouverture=timezone.now(),
|
||||
fermeture=timezone.now()+timezone.timedelta(days=60)
|
||||
fermeture=timezone.now()+timezone.timedelta(days=60),
|
||||
active=True
|
||||
)
|
||||
])
|
||||
tirages = Tirage.objects.all()
|
||||
|
@ -51,6 +54,10 @@ class Command(MyBaseCommand):
|
|||
# ---
|
||||
|
||||
def show_callback(show):
|
||||
"""
|
||||
Assigne un tirage, une date et un lieu à un spectacle et décide si
|
||||
les places sont sur listing.
|
||||
"""
|
||||
show.tirage = random.choice(tirages)
|
||||
show.listing = bool(random.randint(0, 1))
|
||||
show.date = (
|
||||
|
@ -96,4 +103,5 @@ class Command(MyBaseCommand):
|
|||
# On lance le premier tirage
|
||||
# ---
|
||||
|
||||
pass
|
||||
self.stdout.write("Lancement du premier tirage")
|
||||
do_tirage(tirages[0], "dummy_token")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue