mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-05 07:14:11 +02:00
Add API views for participation app
This commit is contained in:
48
apps/participation/api/views.py
Normal file
48
apps/participation/api/views.py
Normal file
@ -0,0 +1,48 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
|
||||
from .serializers import NoteSerializer, ParticipationSerializer, PassageSerializer, PoolSerializer, \
|
||||
SolutionSerializer, SynthesisSerializer, TeamSerializer, TournamentSerializer
|
||||
from ..models import Note, Participation, Passage, Pool, Solution, Synthesis, Team, Tournament
|
||||
|
||||
|
||||
class NoteViewSet(ModelViewSet):
|
||||
queryset = Note.objects.all()
|
||||
serializer_class = NoteSerializer
|
||||
|
||||
|
||||
class ParticipationViewSet(ModelViewSet):
|
||||
queryset = Participation.objects.all()
|
||||
serializer_class = ParticipationSerializer
|
||||
|
||||
|
||||
class PassageViewSet(ModelViewSet):
|
||||
queryset = Passage.objects.all()
|
||||
serializer_class = PassageSerializer
|
||||
|
||||
|
||||
class PoolViewSet(ModelViewSet):
|
||||
queryset = Pool.objects.all()
|
||||
serializer_class = PoolSerializer
|
||||
|
||||
|
||||
class SolutionViewSet(ModelViewSet):
|
||||
queryset = Solution.objects.all()
|
||||
serializer_class = SolutionSerializer
|
||||
|
||||
|
||||
class SynthesisViewSet(ModelViewSet):
|
||||
queryset = Synthesis.objects.all()
|
||||
serializer_class = SynthesisSerializer
|
||||
|
||||
|
||||
class TeamViewSet(ModelViewSet):
|
||||
queryset = Team.objects.all()
|
||||
serializer_class = TeamSerializer
|
||||
|
||||
|
||||
class TournamentViewSet(ModelViewSet):
|
||||
queryset = Tournament.objects.all()
|
||||
serializer_class = TournamentSerializer
|
Reference in New Issue
Block a user