diff --git a/tournaments/models/__init__.py b/tournaments/models/__init__.py index 43669e7..c8ae85d 100644 --- a/tournaments/models/__init__.py +++ b/tournaments/models/__init__.py @@ -2,7 +2,7 @@ from .club import Club from .custom_user import CustomUser from .enums import FederalCategory, FederalLevelCategory, FederalAgeCategory, FederalMatchCategory from .event import Event -from .tournament import Tournament, TeamCall +from .tournament import Tournament, TeamSummon from .group_stage import GroupStage from .round import Round from .match import Match, LiveMatch diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 1a8e4ff..a707003 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -47,19 +47,19 @@ class Tournament(models.Model): def formatted_start_date(self): return self.start_date.strftime("%d/%m/%y") - def team_calls(self): + def team_summons(self): - team_calls = [] + summons = [] for team_registration in self.teamregistration_set.all(): call_date = team_registration.call_date if call_date: names = team_registration.team_names() stage = team_registration.next_stage() weight = team_registration.weight() - team_call = TeamCall(names, call_date, weight, stage, team_registration.logo) - team_calls.append(team_call) + summon = TeamSummon(names, call_date, weight, stage, team_registration.logo) + summons.append(summon) - return team_calls + return summons def live_matches(self): matches = [] @@ -81,7 +81,7 @@ class Tournament(models.Model): # # Convert dictionary to JSON # return json.dumps(dict) -class TeamCall: +class TeamSummon: def __init__(self, names, date, weight, stage, image): self.names = [] self.names = names diff --git a/tournaments/serializers.py b/tournaments/serializers.py index 42fe08f..f845c73 100644 --- a/tournaments/serializers.py +++ b/tournaments/serializers.py @@ -41,8 +41,7 @@ class EventSerializer(serializers.ModelSerializer): class Meta: # club_id = serializers.PrimaryKeyRelatedField(queryset=Club.objects.all()) model = Event - fields = ['id', 'club_id', 'date', 'name', 'federal_tournament_data', 'court_count', 'tenup_id', - 'group_stage_format', 'round_format', 'loser_round_format'] + fields = '__all__' class RoundSerializer(serializers.ModelSerializer): class Meta: diff --git a/tournaments/templates/tournaments/summon_row.html b/tournaments/templates/tournaments/summon_row.html index 59fa842..41805e5 100644 --- a/tournaments/templates/tournaments/summon_row.html +++ b/tournaments/templates/tournaments/summon_row.html @@ -6,12 +6,12 @@