diff --git a/timelaps/serializers.py b/timelaps/serializers.py index 922d985..a22255a 100644 --- a/timelaps/serializers.py +++ b/timelaps/serializers.py @@ -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 \ No newline at end of file diff --git a/timelaps/views.py b/timelaps/views.py index cf14d4f..82552d4 100644 --- a/timelaps/views.py +++ b/timelaps/views.py @@ -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"