Renommage et commentaires.
This commit is contained in:
parent
95b900c9c8
commit
ddde9df944
Binary file not shown.
Binary file not shown.
@ -9,5 +9,5 @@ urlpatterns = [
|
|||||||
path('rules/', ListRulesView.as_view()),
|
path('rules/', ListRulesView.as_view()),
|
||||||
path('teams/', ListTeamView.as_view()),
|
path('teams/', ListTeamView.as_view()),
|
||||||
path('teampilots/', ListTeamPilotView.as_view()),
|
path('teampilots/', ListTeamPilotView.as_view()),
|
||||||
url('race/(?P<raceid>\d+)/team/(?P<teamid>\d+)/relays', ListRelaysByRaceView.as_view()),
|
url('race/(?P<raceid>\d+)/team/(?P<teamid>\d+)/relays', ListRelaysByRaceAndTeamView.as_view()),
|
||||||
]
|
]
|
@ -12,50 +12,36 @@ from .serializers import *
|
|||||||
class ListDriverView(generics.ListAPIView):
|
class ListDriverView(generics.ListAPIView):
|
||||||
"""
|
"""
|
||||||
Provides a get method handler.
|
Provides a get method handler.
|
||||||
"""
|
"""
|
||||||
queryset = Driver.objects.all()
|
queryset = Driver.objects.all()
|
||||||
serializer_class = DriverSerializer
|
serializer_class = DriverSerializer
|
||||||
|
|
||||||
class ListRaceView(generics.ListAPIView):
|
class ListRaceView(generics.ListAPIView):
|
||||||
"""
|
|
||||||
Provides a get method handler.
|
|
||||||
"""
|
|
||||||
queryset = Race.objects.all()
|
queryset = Race.objects.all()
|
||||||
serializer_class = RaceSerializer
|
serializer_class = RaceSerializer
|
||||||
|
|
||||||
class ListRelayView(generics.ListAPIView):
|
class ListRelayView(generics.ListAPIView):
|
||||||
"""
|
|
||||||
Provides a get method handler.
|
|
||||||
"""
|
|
||||||
queryset = Relay.objects.all()
|
queryset = Relay.objects.all()
|
||||||
serializer_class = RelaySerializer
|
serializer_class = RelaySerializer
|
||||||
|
|
||||||
class ListRulesView(generics.ListAPIView):
|
class ListRulesView(generics.ListAPIView):
|
||||||
"""
|
|
||||||
Provides a get method handler.
|
|
||||||
"""
|
|
||||||
queryset = Rules.objects.all()
|
queryset = Rules.objects.all()
|
||||||
serializer_class = RulesSerializer
|
serializer_class = RulesSerializer
|
||||||
|
|
||||||
class ListTeamView(generics.ListAPIView):
|
class ListTeamView(generics.ListAPIView):
|
||||||
"""
|
|
||||||
Provides a get method handler.
|
|
||||||
"""
|
|
||||||
queryset = Team.objects.all()
|
queryset = Team.objects.all()
|
||||||
serializer_class = TeamSerializer
|
serializer_class = TeamSerializer
|
||||||
|
|
||||||
class ListTeamPilotView(generics.ListAPIView):
|
class ListTeamPilotView(generics.ListAPIView):
|
||||||
"""
|
|
||||||
Provides a get method handler.
|
|
||||||
"""
|
|
||||||
queryset = TeamPilot.objects.all()
|
queryset = TeamPilot.objects.all()
|
||||||
serializer_class = TeamPilotSerializer
|
serializer_class = TeamPilotSerializer
|
||||||
|
|
||||||
class ListRelaysByRaceView(generics.ListAPIView):
|
|
||||||
'''
|
class ListRelaysByRaceAndTeamView(generics.ListAPIView):
|
||||||
|
"""
|
||||||
Getting the params from the url with the "self.kwargs.get"
|
Getting the params from the url with the "self.kwargs.get"
|
||||||
and filter with thoses in the relays relation
|
and filter with thoses in the relays relation
|
||||||
'''
|
"""
|
||||||
serializer_class = RelayPilotSerializer
|
serializer_class = RelayPilotSerializer
|
||||||
lookup_url_raceid = "raceid"
|
lookup_url_raceid = "raceid"
|
||||||
lookup_url_teamid = "teamid"
|
lookup_url_teamid = "teamid"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user