Coverage for timelaps/views.py : 93%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
# Create your views here.
""" Provides a get method handler. """
raceid = self.kwargs['raceid'] return Race.objects.filter(id=raceid)
def get_queryset(self): raceid = self.kwargs['raceid'] teamid = self.kwargs['teamid'] return Relay.objects.filter(team_pilot__team=teamid).filter(team_pilot__race=raceid)
class ListRelaysByRaceAndTeamView(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"
def get_queryset(self): raceid = self.kwargs.get(self.lookup_url_raceid) teamid = self.kwargs.get(self.lookup_url_teamid) relays = Relay.objects.filter(team_pilot__team=teamid).filter(team_pilot__race=raceid) return relays """ |