mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 06:22:22 +00:00
Fix export scripts
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
20daecf619
commit
230dc545f4
@ -5,7 +5,7 @@ from django.core.management import BaseCommand
|
|||||||
from django.utils.formats import date_format
|
from django.utils.formats import date_format
|
||||||
from django.utils.translation import activate
|
from django.utils.translation import activate
|
||||||
|
|
||||||
from .models import Tournament
|
from participation.models import Tournament
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
@ -3,29 +3,18 @@
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
from django.utils.translation import activate
|
from django.utils.translation import activate
|
||||||
|
|
||||||
from .models import Solution, Tournament
|
from participation.models import Solution, Tournament
|
||||||
|
|
||||||
|
|
||||||
PROBLEMS = [
|
|
||||||
"Pliage de polygones",
|
|
||||||
"Mélodie des hirondelles",
|
|
||||||
"Professeur confiné",
|
|
||||||
"Nain sans mémoire",
|
|
||||||
"Bricolage microscopique",
|
|
||||||
"Villes jumelées",
|
|
||||||
"Promenade de chiens",
|
|
||||||
"Persée et la Gorgone",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
def handle(self, *args, **kwargs):
|
def handle(self, *args, **kwargs):
|
||||||
activate('fr')
|
activate('fr')
|
||||||
|
|
||||||
base_dir = Path(__file__).parent.parent.parent.parent.parent
|
base_dir = Path(__file__).parent.parent.parent.parent
|
||||||
base_dir /= "output"
|
base_dir /= "output"
|
||||||
if not base_dir.is_dir():
|
if not base_dir.is_dir():
|
||||||
base_dir.mkdir()
|
base_dir.mkdir()
|
||||||
@ -41,7 +30,7 @@ class Command(BaseCommand):
|
|||||||
if not base_dir.is_dir():
|
if not base_dir.is_dir():
|
||||||
base_dir.mkdir()
|
base_dir.mkdir()
|
||||||
|
|
||||||
for problem_id, problem_name in enumerate(PROBLEMS):
|
for problem_id, problem_name in enumerate(settings.PROBLEMS):
|
||||||
dir_name = f"Problème n°{problem_id + 1} : {problem_name}"
|
dir_name = f"Problème n°{problem_id + 1} : {problem_name}"
|
||||||
problem_dir = base_dir / dir_name
|
problem_dir = base_dir / dir_name
|
||||||
if not problem_dir.is_dir():
|
if not problem_dir.is_dir():
|
||||||
|
Loading…
Reference in New Issue
Block a user