From 71aadbfc93fd6e0ab7311b74e51121c41149624d Mon Sep 17 00:00:00 2001 From: James Turk Date: Fri, 24 Aug 2012 21:38:48 -0400 Subject: [PATCH] limit to start_date --- fowl/game/models.py | 1 + fowl/game/views.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fowl/game/models.py b/fowl/game/models.py index b4408f3..6438fc2 100644 --- a/fowl/game/models.py +++ b/fowl/game/models.py @@ -302,6 +302,7 @@ class MatchTeam(models.Model): class League(models.Model): name = models.CharField(max_length=100) active = models.BooleanField(default=True) + start_date = models.DateField() raw_picks = models.IntegerField(default=3) smackdown_picks = models.IntegerField(default=3) diva_picks = models.IntegerField(default=2) diff --git a/fowl/game/views.py b/fowl/game/views.py index 2948105..7cb4687 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -113,7 +113,8 @@ def league(request, league_id): belt_mapping = {'smackdown': 'ic', 'raw': 'us'} # go over all events in order to determine belt holders - for event in Event.objects.all().order_by('date'): + for event in Event.objects.filter(date__gte=league.start_date + ).order_by('date'): # determine which belt is being competed for belt_name = belt_mapping.get(event.name.lower(), 'world') # get team scores for this event