Ajout de commentaires

This commit is contained in:
bglacial 2019-01-14 21:54:31 +01:00
parent fa21495884
commit 3aa52bbb6a
2 changed files with 7 additions and 0 deletions

View File

@ -36,5 +36,8 @@ class RelayPilotSerializer(serializers.ModelSerializer):
model = Relay
#fields = ('relay_start','relay_end','has_refuel','pilot_chrono','comment','team_pilot','race')
fields = '__all__'
'''
To get linked elements référenced by a foreign key, use depth to adjust the depth of the request.
'''
depth = 2

View File

@ -52,6 +52,10 @@ class ListTeamPilotView(generics.ListAPIView):
serializer_class = TeamPilotSerializer
class ListRelaysByRaceView(generics.ListAPIView):
'''
Getting the params from the url with the "self.kwargs.get"
and filter with thoses in the relays relation
'''
serializer_class = RelayPilotSerializer
lookup_url_raceid = "raceid"
lookup_url_teamid = "teamid"