latest raw and a fix for the battle royal points

This commit is contained in:
James Turk 2012-06-25 23:12:22 -04:00
parent e150e0ca8a
commit 0b75181002
2 changed files with 20 additions and 1 deletions

View File

@ -186,6 +186,8 @@ class Match(models.Model):
losers = [] losers = []
title_teams = {} title_teams = {}
team_count = 0 team_count = 0
battle_royal = False
for team in self.teams.all(): for team in self.teams.all():
for star in team.members.all(): for star in team.members.all():
points[star.id] = 0 points[star.id] = 0
@ -218,6 +220,7 @@ class Match(models.Model):
elif team_count > 6: elif team_count > 6:
base_points = team_count / 2 base_points = team_count / 2
allies = 0 # no allies in a rumble allies = 0 # no allies in a rumble
battle_royal = True
else: else:
# normal wins are worth 2 # normal wins are worth 2
allies = winner_count - 1 allies = winner_count - 1
@ -245,7 +248,7 @@ class Match(models.Model):
for star in title_teams[self.title_at_stake for star in title_teams[self.title_at_stake
].members.all(): ].members.all():
points[star.id] += 1 points[star.id] += 1
else: elif not battle_royal:
# look over titles in match, to score a title-nondefense # look over titles in match, to score a title-nondefense
for title, title_team in title_teams.iteritems(): for title, title_team in title_teams.iteritems():
# beat someone w/ title in a non-defense # beat someone w/ title in a non-defense

View File

@ -218,3 +218,19 @@ event.add_match(['jimmyuso', 'jeyuso'], ['titusoneil', 'darrenyoung'],
event.add_match('sheamus', 'dolphziggler', winner='sheamus', event.add_match('sheamus', 'dolphziggler', winner='sheamus',
outcome='normal') outcome='normal')
league.score_event(event) league.score_event(event)
event = Event.objects.create(name='RAW', date='2012-06-25')
event.add_match('kane', 'cmpunk', 'danielbryan', winner='danielbryan',
outcome='normal')
event.add_match('brodusclay', 'bigshow', winner='bigshow', outcome='normal')
event.add_match('santinomarella', 'jackswagger', winner='santinomarella',
title_at_stake='us', outcome='normal')
event.add_match('dolphziggler', 'albertodelrio', notes='botched?')
event.add_match('bethphoenix', 'aliciafox', 'kaitlyn', 'maxine', 'rosamendes',
'nobody1', 'vickieguerrero', 'aj', 'natalya', 'layla',
winner='aj', notes='beach battle royal')
event.add_match('johncena', 'chrisjericho', outcome='dq', winner='johncena',
notes='big show interferes')
league.score_event(event)