diff --git a/tournaments/migrations/0094_alter_customuser_bracket_match_format_preference_and_more.py b/tournaments/migrations/0094_alter_customuser_bracket_match_format_preference_and_more.py new file mode 100644 index 0000000..f72d36f --- /dev/null +++ b/tournaments/migrations/0094_alter_customuser_bracket_match_format_preference_and_more.py @@ -0,0 +1,58 @@ +# Generated by Django 4.2.11 on 2024-11-18 08:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tournaments', '0093_drawlog_draw_type_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='customuser', + name='bracket_match_format_preference', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='customuser', + name='group_stage_match_format_preference', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='customuser', + name='loser_bracket_match_format_preference', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='groupstage', + name='format', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='match', + name='format', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='round', + name='format', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='tournament', + name='group_stage_format', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='tournament', + name='loser_round_format', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + migrations.AlterField( + model_name='tournament', + name='round_format', + field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point'), (10, 'Two sets of Super Tie-Break decisive point'), (11, 'Single set'), (12, 'Single set with decisive point'), (13, 'Single set of four games'), (14, 'Single set of four games with decisive point')], default=3, null=True), + ), + ] diff --git a/tournaments/models/enums.py b/tournaments/models/enums.py index 02827a1..f3228d1 100644 --- a/tournaments/models/enums.py +++ b/tournaments/models/enums.py @@ -47,6 +47,8 @@ class FederalMatchCategory(models.IntegerChoices): TWO_SETS_OF_SUPER_TIE = 10, 'Two sets of Super Tie-Break decisive point' SINGLE_SET = 11, 'Single set' SINGLE_SET_DECISIVE_POINT = 12, 'Single set with decisive point' + SINGLE_SET_OF_FOUR_GAMES = 13, 'Single set of four games' + SINGLE_SET_OF_FOUR_GAMES_DECISIVE_POINT = 14, 'Single set of four games with decisive point' def last_set_is_tie_break(value): if value == FederalMatchCategory.TWO_SETS_FOUR_GAME or value == FederalMatchCategory.TWO_SETS_FOUR_GAME_DECISIVE_POINT or value == FederalMatchCategory.TWO_SETS_SUPER_TIE or value == FederalMatchCategory.SUPER_TIE or value == FederalMatchCategory.MEGA_TIE or value == FederalMatchCategory.TWO_SETS_DECISIVE_POINT_SUPER_TIE: @@ -55,7 +57,7 @@ class FederalMatchCategory(models.IntegerChoices): return False def max_number_of_sets(value): - if value == FederalMatchCategory.SUPER_TIE or value == FederalMatchCategory.MEGA_TIE or value == FederalMatchCategory.NINE_GAMES or value == FederalMatchCategory.NINE_GAMES_DECISIVE_POINT or value == FederalMatchCategory.SINGLE_SET or value == FederalMatchCategory.SINGLE_SET_DECISIVE_POINT: + if value == FederalMatchCategory.SUPER_TIE or value == FederalMatchCategory.MEGA_TIE or value == FederalMatchCategory.NINE_GAMES or value == FederalMatchCategory.NINE_GAMES_DECISIVE_POINT or value == FederalMatchCategory.SINGLE_SET or value == FederalMatchCategory.SINGLE_SET_DECISIVE_POINT or value == FederalMatchCategory.SINGLE_SET_OF_FOUR_GAMES or value == FederalMatchCategory.SINGLE_SET_OF_FOUR_GAMES_DECISIVE_POINT: return 1 else: return 3