1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-11-26 14:47:09 +00:00
plateforme-tfjm2/participation/management/commands/update_notation_sheets.py
Emmy D'Anello c522387482
Export notation sheets on Google Sheets
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-03-30 13:41:46 +01:00

18 lines
701 B
Python

# Copyright (C) 2024 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
from django.core.management import BaseCommand
from participation.models import Tournament
class Command(BaseCommand):
def handle(self, *args, **options):
for tournament in Tournament.objects.all():
if options['verbosity'] >= 1:
self.stdout.write(f"Updating notation sheet for {tournament}")
tournament.create_spreadsheet()
for pool in tournament.pools.all():
if options['verbosity'] >= 1:
self.stdout.write(f"Updating notation sheet for pool {pool.short_name} for {tournament}")
pool.update_spreadsheet()