From 0b751810024255597f1e47d29be54c3974b59848 Mon Sep 17 00:00:00 2001 From: James Turk Date: Mon, 25 Jun 2012 23:12:22 -0400 Subject: [PATCH] latest raw and a fix for the battle royal points --- fowl/game/models.py | 5 ++++- league.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/fowl/game/models.py b/fowl/game/models.py index e66dbf1..864f5e4 100644 --- a/fowl/game/models.py +++ b/fowl/game/models.py @@ -186,6 +186,8 @@ class Match(models.Model): losers = [] title_teams = {} team_count = 0 + battle_royal = False + for team in self.teams.all(): for star in team.members.all(): points[star.id] = 0 @@ -218,6 +220,7 @@ class Match(models.Model): elif team_count > 6: base_points = team_count / 2 allies = 0 # no allies in a rumble + battle_royal = True else: # normal wins are worth 2 allies = winner_count - 1 @@ -245,7 +248,7 @@ class Match(models.Model): for star in title_teams[self.title_at_stake ].members.all(): points[star.id] += 1 - else: + elif not battle_royal: # look over titles in match, to score a title-nondefense for title, title_team in title_teams.iteritems(): # beat someone w/ title in a non-defense diff --git a/league.py b/league.py index 670507e..3d25195 100644 --- a/league.py +++ b/league.py @@ -218,3 +218,19 @@ event.add_match(['jimmyuso', 'jeyuso'], ['titusoneil', 'darrenyoung'], event.add_match('sheamus', 'dolphziggler', winner='sheamus', outcome='normal') 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) +