Ajout de commentaires
This commit is contained in:
parent
fa21495884
commit
3aa52bbb6a
@ -36,5 +36,8 @@ class RelayPilotSerializer(serializers.ModelSerializer):
|
|||||||
model = Relay
|
model = Relay
|
||||||
#fields = ('relay_start','relay_end','has_refuel','pilot_chrono','comment','team_pilot','race')
|
#fields = ('relay_start','relay_end','has_refuel','pilot_chrono','comment','team_pilot','race')
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
'''
|
||||||
|
To get linked elements référenced by a foreign key, use depth to adjust the depth of the request.
|
||||||
|
'''
|
||||||
depth = 2
|
depth = 2
|
||||||
|
|
@ -52,6 +52,10 @@ class ListTeamPilotView(generics.ListAPIView):
|
|||||||
serializer_class = TeamPilotSerializer
|
serializer_class = TeamPilotSerializer
|
||||||
|
|
||||||
class ListRelaysByRaceView(generics.ListAPIView):
|
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
|
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