limit to start_date
This commit is contained in:
parent
ea06882aff
commit
71aadbfc93
@ -302,6 +302,7 @@ class MatchTeam(models.Model):
|
|||||||
class League(models.Model):
|
class League(models.Model):
|
||||||
name = models.CharField(max_length=100)
|
name = models.CharField(max_length=100)
|
||||||
active = models.BooleanField(default=True)
|
active = models.BooleanField(default=True)
|
||||||
|
start_date = models.DateField()
|
||||||
raw_picks = models.IntegerField(default=3)
|
raw_picks = models.IntegerField(default=3)
|
||||||
smackdown_picks = models.IntegerField(default=3)
|
smackdown_picks = models.IntegerField(default=3)
|
||||||
diva_picks = models.IntegerField(default=2)
|
diva_picks = models.IntegerField(default=2)
|
||||||
|
@ -113,7 +113,8 @@ def league(request, league_id):
|
|||||||
belt_mapping = {'smackdown': 'ic', 'raw': 'us'}
|
belt_mapping = {'smackdown': 'ic', 'raw': 'us'}
|
||||||
|
|
||||||
# go over all events in order to determine belt holders
|
# 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
|
# determine which belt is being competed for
|
||||||
belt_name = belt_mapping.get(event.name.lower(), 'world')
|
belt_name = belt_mapping.get(event.name.lower(), 'world')
|
||||||
# get team scores for this event
|
# get team scores for this event
|
||||||
|
Loading…
Reference in New Issue
Block a user