1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-01-24 18:21:19 +00:00

71 lines
1.9 KiB
Python
Raw Normal View History

2021-03-29 15:41:20 +02:00
# Copyright (C) 2020 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
from rest_framework import serializers
from ..models import Note, Participation, Passage, Pool, Solution, Team, Tournament, WrittenReview
2021-03-29 15:41:20 +02:00
class NoteSerializer(serializers.ModelSerializer):
class Meta:
model = Note
fields = '__all__'
class ParticipationSerializer(serializers.ModelSerializer):
class Meta:
model = Participation
fields = '__all__'
class PassageSerializer(serializers.ModelSerializer):
class Meta:
model = Passage
fields = '__all__'
class PoolSerializer(serializers.ModelSerializer):
2021-04-04 12:17:54 +02:00
passages = serializers.ListSerializer(child=PassageSerializer(), read_only=True)
2021-03-29 16:06:09 +02:00
2021-03-29 15:41:20 +02:00
class Meta:
model = Pool
fields = '__all__'
class SolutionSerializer(serializers.ModelSerializer):
class Meta:
model = Solution
fields = '__all__'
class WrittenReviewSerializer(serializers.ModelSerializer):
2021-03-29 15:41:20 +02:00
class Meta:
model = WrittenReview
2021-03-29 15:41:20 +02:00
fields = '__all__'
class TeamSerializer(serializers.ModelSerializer):
2021-03-29 16:06:09 +02:00
participation = ParticipationSerializer()
2021-03-29 15:41:20 +02:00
class Meta:
model = Team
fields = '__all__'
class TournamentSerializer(serializers.ModelSerializer):
2021-04-04 11:35:00 +02:00
participations = serializers.ListSerializer(child=ParticipationSerializer())
2021-03-29 15:41:20 +02:00
class Meta:
model = Tournament
2021-05-11 17:19:28 +02:00
fields = ('id', 'pk', 'name', 'date_start', 'date_end', 'place', 'max_teams', 'price', 'remote',
'inscription_limit', 'solution_limit', 'solutions_draw', 'reviews_first_phase_limit',
'solutions_available_second_phase', 'reviews_second_phase_limit',
'solutions_available_third_phase', 'reviews_third_phase_limit',
2021-03-29 16:06:09 +02:00
'description', 'organizers', 'final', 'participations',)
class TweakSerializer(serializers.ModelSerializer):
class Meta:
model = Team
fields = '__all__'