|
|
|
|
@ -30,7 +30,7 @@ class TournamentSerializer(serializers.ModelSerializer): |
|
|
|
|
# event_id = serializers.PrimaryKeyRelatedField(queryset=Event.objects.all()) |
|
|
|
|
# creator_id = serializers.PrimaryKeyRelatedField(queryset=CustomUser.objects.all()) |
|
|
|
|
model = Tournament |
|
|
|
|
fields = ['id', 'name', 'event', 'creator', 'start_date', 'end_date', 'creation_date', |
|
|
|
|
fields = ['id', 'name', 'event', 'creator_id', 'start_date', 'end_date', 'creation_date', |
|
|
|
|
'is_private', 'format', 'group_stage_format', 'round_format', 'loser_round_format', 'bracket_sort_mode', |
|
|
|
|
'group_stage_count', 'rank_source_date', 'day_duration', 'team_count', 'team_sorting', |
|
|
|
|
'federal_category', 'federal_level_category', 'federal_age_category', 'group_stage_court_count', |
|
|
|
|
@ -41,7 +41,7 @@ class EventSerializer(serializers.ModelSerializer): |
|
|
|
|
class Meta: |
|
|
|
|
# club_id = serializers.PrimaryKeyRelatedField(queryset=Club.objects.all()) |
|
|
|
|
model = Event |
|
|
|
|
fields = ['id', 'club', 'date', 'name', 'federal_tournament_data', 'court_count', 'tenup_id', |
|
|
|
|
fields = ['id', 'club_id', 'date', 'name', 'federal_tournament_data', 'court_count', 'tenup_id', |
|
|
|
|
'group_stage_format', 'round_format', 'loser_round_format'] |
|
|
|
|
|
|
|
|
|
class RoundSerializer(serializers.ModelSerializer): |
|
|
|
|
@ -49,34 +49,34 @@ class RoundSerializer(serializers.ModelSerializer): |
|
|
|
|
# tournament_id = serializers.PrimaryKeyRelatedField(queryset=Tournament.objects.all()) |
|
|
|
|
# loser_id = serializers.PrimaryKeyRelatedField(queryset=Round.objects.all()) |
|
|
|
|
model = Round |
|
|
|
|
fields = ['id', 'index', 'tournament', 'loser', 'format'] |
|
|
|
|
fields = ['id', 'index', 'tournament_id', 'loser', 'format'] |
|
|
|
|
|
|
|
|
|
class GroupStageSerializer(serializers.ModelSerializer): |
|
|
|
|
class Meta: |
|
|
|
|
# tournament_id = serializers.PrimaryKeyRelatedField(queryset=Tournament.objects.all()) |
|
|
|
|
model = GroupStage |
|
|
|
|
fields = ['id', 'index', 'tournament', 'format'] |
|
|
|
|
fields = ['id', 'index', 'tournament_id', 'format'] |
|
|
|
|
|
|
|
|
|
class MatchSerializer(serializers.ModelSerializer): |
|
|
|
|
class Meta: |
|
|
|
|
# round_id = serializers.PrimaryKeyRelatedField(queryset=Round.objects.all()) |
|
|
|
|
# group_stage_id = serializers.PrimaryKeyRelatedField(queryset=GroupStage.objects.all()) |
|
|
|
|
model = Match |
|
|
|
|
fields = ['id', 'round', 'group_stage', 'index', 'format', 'court', 'start_date', 'end_date', |
|
|
|
|
fields = ['id', 'round_id', 'group_stage_id', 'index', 'format', 'court', 'start_date', 'end_date', |
|
|
|
|
'serving_team_id', 'winning_team_id', 'losing_team_id'] |
|
|
|
|
|
|
|
|
|
class TeamScoreSerializer(serializers.ModelSerializer): |
|
|
|
|
class Meta: |
|
|
|
|
# match_id = serializers.PrimaryKeyRelatedField(queryset=Match.objects.all()) |
|
|
|
|
model = TeamScore |
|
|
|
|
fields = ['id', 'match', 'score', 'walk_out', 'lucky_loser'] |
|
|
|
|
fields = ['id', 'match_id', 'score', 'walk_out', 'lucky_loser'] |
|
|
|
|
|
|
|
|
|
class TeamRegistrationSerializer(serializers.ModelSerializer): |
|
|
|
|
class Meta: |
|
|
|
|
# match_id = serializers.PrimaryKeyRelatedField(queryset=Match.objects.all()) |
|
|
|
|
# group_stage_id = serializers.PrimaryKeyRelatedField(queryset=GroupStage.objects.all()) |
|
|
|
|
model = TeamRegistration |
|
|
|
|
fields = ['id', 'group_stage', 'registration_date', 'call_date', 'initial_position', |
|
|
|
|
fields = ['id', 'group_stage_id', 'registration_date', 'call_date', 'bracket_position', |
|
|
|
|
'group_stage_position', 'logo'] |
|
|
|
|
|
|
|
|
|
class PlayerRegistrationSerializer(serializers.ModelSerializer): |
|
|
|
|
@ -84,7 +84,7 @@ class PlayerRegistrationSerializer(serializers.ModelSerializer): |
|
|
|
|
# team_registration_id = serializers.PrimaryKeyRelatedField(queryset=TeamRegistration.objects.all()) |
|
|
|
|
# team_state_id = serializers.PrimaryKeyRelatedField(queryset=TeamState.objects.all()) |
|
|
|
|
model = PlayerRegistration |
|
|
|
|
fields = ['id', 'team_registration', 'first_name', 'last_name', 'licence_id', 'rank', 'has_paid'] |
|
|
|
|
fields = ['id', 'team_registration_id', 'first_name', 'last_name', 'licence_id', 'rank', 'has_paid'] |
|
|
|
|
|
|
|
|
|
class ChangePasswordSerializer(serializers.Serializer): |
|
|
|
|
old_password = serializers.CharField(max_length=128, write_only=True, required=True) |
|
|
|
|
|