Exécution de la requête avec les paramètres
This commit is contained in:
parent
6b349b0dc2
commit
d66cd4e033
@ -52,11 +52,6 @@ class ListTeamPilotView(generics.ListAPIView):
|
|||||||
serializer_class = TeamPilotSerializer
|
serializer_class = TeamPilotSerializer
|
||||||
|
|
||||||
class ListRelaysByRaceView(generics.ListAPIView):
|
class ListRelaysByRaceView(generics.ListAPIView):
|
||||||
|
|
||||||
queryset = Relay.objects.select_related('team_pilot').all()
|
|
||||||
serializer_class = RelayPilotSerializer
|
|
||||||
|
|
||||||
'''
|
|
||||||
serializer_class = RelayPilotSerializer
|
serializer_class = RelayPilotSerializer
|
||||||
lookup_url_raceid = "raceid"
|
lookup_url_raceid = "raceid"
|
||||||
lookup_url_teamid = "teamid"
|
lookup_url_teamid = "teamid"
|
||||||
@ -65,7 +60,4 @@ class ListRelaysByRaceView(generics.ListAPIView):
|
|||||||
raceid = self.kwargs.get(self.lookup_url_raceid)
|
raceid = self.kwargs.get(self.lookup_url_raceid)
|
||||||
teamid = self.kwargs.get(self.lookup_url_teamid)
|
teamid = self.kwargs.get(self.lookup_url_teamid)
|
||||||
relays = Relay.objects.filter(team_pilot__team=teamid).filter(team_pilot__race=raceid)
|
relays = Relay.objects.filter(team_pilot__team=teamid).filter(team_pilot__race=raceid)
|
||||||
|
return relays
|
||||||
return relays
|
|
||||||
|
|
||||||
'''
|
|
Loading…
x
Reference in New Issue
Block a user