plateforme-tfjm2/apps/participation/api/serializers.py

57 lines
1.2 KiB
Python

# 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, Synthesis, Team, Tournament
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):
class Meta:
model = Pool
fields = '__all__'
class SolutionSerializer(serializers.ModelSerializer):
class Meta:
model = Solution
fields = '__all__'
class SynthesisSerializer(serializers.ModelSerializer):
class Meta:
model = Synthesis
fields = '__all__'
class TeamSerializer(serializers.ModelSerializer):
class Meta:
model = Team
fields = '__all__'
class TournamentSerializer(serializers.ModelSerializer):
teams = serializers.ListSerializer()
class Meta:
model = Tournament
fields = '__all__'