mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 03:42:11 +01:00 
			
		
		
		
	Export notation sheets on Google Sheets
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		
							
								
								
									
										17
									
								
								participation/management/commands/update_notation_sheets.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								participation/management/commands/update_notation_sheets.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
# 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()
 | 
			
		||||
		Reference in New Issue
	
	Block a user