1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-11-26 16:47:10 +00:00
plateforme-tfjm2/participation/management/commands/update_notation_sheets.py

18 lines
701 B
Python
Raw Normal View History

# 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()