From fed287ce43eef985cfa3d1d3971f714aecf3914f Mon Sep 17 00:00:00 2001 From: Raz Date: Mon, 5 May 2025 11:32:58 +0200 Subject: [PATCH] add animation type variable --- .../0118_tournament_animation_type.py | 18 ++++++++++++++++++ tournaments/models/__init__.py | 2 +- tournaments/models/enums.py | 4 ++++ tournaments/models/tournament.py | 3 ++- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tournaments/migrations/0118_tournament_animation_type.py diff --git a/tournaments/migrations/0118_tournament_animation_type.py b/tournaments/migrations/0118_tournament_animation_type.py new file mode 100644 index 0000000..bfea7d1 --- /dev/null +++ b/tournaments/migrations/0118_tournament_animation_type.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1 on 2025-05-03 05:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tournaments', '0117_playerregistration_user_teamregistration_user_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='tournament', + name='animation_type', + field=models.IntegerField(choices=[(0, 'Tournoi'), (1, 'Mêlée')], default=0), + ), + ] diff --git a/tournaments/models/__init__.py b/tournaments/models/__init__.py index 8d1530e..9dd7d03 100644 --- a/tournaments/models/__init__.py +++ b/tournaments/models/__init__.py @@ -4,7 +4,7 @@ from .custom_user import CustomUser from .club import Club from .court import Court from .date_interval import DateInterval -from .enums import UserOrigin, TournamentPayment, FederalCategory, FederalLevelCategory, FederalAgeCategory, FederalMatchCategory, OnlineRegistrationStatus, RegistrationStatus, ModelOperation +from .enums import UserOrigin, TournamentPayment, FederalCategory, FederalLevelCategory, FederalAgeCategory, FederalMatchCategory, OnlineRegistrationStatus, RegistrationStatus, AnimationType, ModelOperation from .player_enums import PlayerSexType, PlayerDataSource, PlayerPaymentType from .event import Event from .tournament import Tournament, TeamSummon, TeamSortingType, TeamItem diff --git a/tournaments/models/enums.py b/tournaments/models/enums.py index 22abf9e..2e7315f 100644 --- a/tournaments/models/enums.py +++ b/tournaments/models/enums.py @@ -303,3 +303,7 @@ class RegistrationPaymentMode(models.IntegerChoices): CORPORATE = 1, 'Corporate' NO_FEE = 2, 'No Service Fee' STRIPE = 3, 'Stripe' + +class AnimationType(models.IntegerChoices): + TOURNAMENT = 0, 'Tournoi' + MELEE = 1, 'Mêlée' diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 17bff1a..074d21f 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -1,6 +1,6 @@ from zoneinfo import ZoneInfo from django.db import models -from . import BaseModel, Event, TournamentPayment, FederalMatchCategory, FederalCategory, FederalLevelCategory, FederalAgeCategory, OnlineRegistrationStatus, RegistrationStatus +from . import BaseModel, Event, TournamentPayment, FederalMatchCategory, FederalCategory, FederalLevelCategory, FederalAgeCategory, OnlineRegistrationStatus, RegistrationStatus, AnimationType import uuid from django.utils import timezone, formats @@ -89,6 +89,7 @@ class Tournament(BaseModel): enable_time_to_confirm = models.BooleanField(default=False) is_corporate_tournament = models.BooleanField(default=False) is_template = models.BooleanField(default=False) + animation_type = models.IntegerField(default=AnimationType.TOURNAMENT, choices=AnimationType.choices) def delete_dependencies(self): for team_registration in self.team_registrations.all():