Beispiel #1
0
    def get_queryset(self):
        round = self.request.query_params.get('round', None)
        if round is None:
            round = get_current_round()

        round_object = Round.objects.get(round=round)
        return Game.objects.filter(round=round_object)
Beispiel #2
0
 def get_queryset(self):
     scores = RoundScore.objects.all()
     scores = [
         score for score in scores
         if score.round.round <= get_current_round()
     ]
     return scores
Beispiel #3
0
    def get_queryset(self):
        round = self.request.query_params.get('round', None)
        if round is None:
            round = get_current_round()

        round_object = Round.objects.get(round=round)
        return Game.objects.filter(round=round_object)
Beispiel #4
0
    def get_queryset(self):

        round = self.request.query_params.get('round', None)
        user = self.request.user

        current_round = get_current_round()
        if round is None:
            round = current_round
        else:
            round = int(round)

        # Get the tips for the round
        tips = Tip.objects.filter(user=user, round=round)

        # If its a future round, or an invalid round, return nothing
        if round>current_round or round<1:
            return tips

        # If it's the current round, and the user hasn't tipped yet, populate with defaults
        elif round==current_round and not tips:
            default_tips(round, user)
            tips = Tip.objects.filter(user=user, round=round)

        return tips
Beispiel #5
0
    def get_queryset(self):

        round = self.request.query_params.get('round', None)
        user = self.request.user

        current_round = get_current_round()
        if round is None:
            round = current_round
        else:
            round = int(round)

        # Get the tips for the round
        tips = Tip.objects.filter(user=user, round=round)

        # If its a future round, or an invalid round, return nothing
        if round > current_round or round < 1:
            return tips

        # If it's the current round, and the user hasn't tipped yet, populate with defaults
        elif round == current_round and not tips:
            default_tips(round, user)
            tips = Tip.objects.filter(user=user, round=round)

        return tips
Beispiel #6
0
def CurrentRoundView(request):
    return JsonResponse({'round': get_current_round()})
Beispiel #7
0
 def get_queryset(self):
     scores = RoundScore.objects.all()
     scores = [score for score in scores if score.round.round<=get_current_round()]
     return scores
Beispiel #8
0
def CurrentRoundView(request):
    return JsonResponse({'round': get_current_round()})