From da303edb044aee73223c78a3b0140fdbcaa9fa23 Mon Sep 17 00:00:00 2001 From: James Turk Date: Fri, 24 Aug 2012 22:08:04 -0400 Subject: [PATCH] fix for view w/ end 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 6438fc2..ad81353 100644 --- a/fowl/game/models.py +++ b/fowl/game/models.py @@ -303,6 +303,7 @@ class League(models.Model): name = models.CharField(max_length=100) active = models.BooleanField(default=True) start_date = models.DateField() + end_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 7cb4687..1b9aea9 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.filter(date__gte=league.start_date + for event in Event.objects.filter(date__gte=league.start_date, + date__lte=league.end_date ).order_by('date'): # determine which belt is being competed for belt_name = belt_mapping.get(event.name.lower(), 'world')