mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-12-26 04:22:24 +00:00
Export games
This commit is contained in:
parent
a64d600645
commit
4de83344a7
@ -2,7 +2,7 @@ from argparse import FileType
|
|||||||
from sys import stdin
|
from sys import stdin
|
||||||
|
|
||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
from media.models import BD, CD, Manga, Revue, Roman, Vinyle
|
from media.models import BD, CD, Manga, Revue, Roman, Vinyle, Jeu
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@ -69,3 +69,17 @@ class Command(BaseCommand):
|
|||||||
if medium.day:
|
if medium.day:
|
||||||
f.write(f"Jour : {medium.day}\n\n")
|
f.write(f"Jour : {medium.day}\n\n")
|
||||||
f.write("\n\n\n")
|
f.write("\n\n\n")
|
||||||
|
|
||||||
|
# Traitement différent pour les jeux
|
||||||
|
with open(directory + "/docs/jeux.md", "w") as f:
|
||||||
|
f.write("# Jeux\n\n\n")
|
||||||
|
|
||||||
|
for game in Jeu.objects.order_by("name").all():
|
||||||
|
f.write(f"## {game.name}\n\n\n")
|
||||||
|
f.write(f"Durée : {game.duree}\n\n")
|
||||||
|
f.write(f"Nombre de joueurs : {game.nombre_joueurs_min} - {game.nombre_joueurs_max}\n\n")
|
||||||
|
if game.proprietaire.username != "Med":
|
||||||
|
f.write(f"Propriétaire : {game.proprietaire.username}\n\n")
|
||||||
|
if game.comment:
|
||||||
|
f.write(f"Commentaire : {game.comment}\n\n")
|
||||||
|
f.write("\n\n\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user