switch win_type to outcome, add brawls and appearances
This commit is contained in:
parent
956c7694d9
commit
b3707c0386
@ -4,8 +4,9 @@ from django.contrib.auth.models import User
|
|||||||
|
|
||||||
# these things are independent of the game
|
# these things are independent of the game
|
||||||
|
|
||||||
WIN_TYPES = (
|
OUTCOMES = (
|
||||||
('pin', 'pin'),
|
('no contest', 'no contest'),
|
||||||
|
('normal', 'normal'),
|
||||||
('DQ', 'DQ'),
|
('DQ', 'DQ'),
|
||||||
('submission', 'submission'),
|
('submission', 'submission'),
|
||||||
('appearance', 'appearance'),
|
('appearance', 'appearance'),
|
||||||
@ -48,7 +49,7 @@ class Event(models.Model):
|
|||||||
|
|
||||||
def add_match(self, *teams, **kwargs):
|
def add_match(self, *teams, **kwargs):
|
||||||
winner = kwargs.get('winner', None)
|
winner = kwargs.get('winner', None)
|
||||||
win_type = kwargs.get('win_type', '')
|
outcome = kwargs.get('outcome', '')
|
||||||
title_at_stake = kwargs.get('title_at_stake', False)
|
title_at_stake = kwargs.get('title_at_stake', False)
|
||||||
notes = kwargs.get('notes', '')
|
notes = kwargs.get('notes', '')
|
||||||
|
|
||||||
@ -71,9 +72,9 @@ class Event(models.Model):
|
|||||||
mt.save()
|
mt.save()
|
||||||
mt.members.add(member)
|
mt.members.add(member)
|
||||||
if winner:
|
if winner:
|
||||||
match.record_win(winner, win_type)
|
match.record_win(winner, outcome)
|
||||||
else:
|
else:
|
||||||
match.win_type = win_type
|
match.outcome = outcome
|
||||||
match.save()
|
match.save()
|
||||||
return match
|
return match
|
||||||
|
|
||||||
@ -84,16 +85,16 @@ class Event(models.Model):
|
|||||||
class Match(models.Model):
|
class Match(models.Model):
|
||||||
event = models.ForeignKey(Event, related_name='matches')
|
event = models.ForeignKey(Event, related_name='matches')
|
||||||
winner = models.ForeignKey(Star, null=True)
|
winner = models.ForeignKey(Star, null=True)
|
||||||
win_type = models.CharField(max_length=10, choices=WIN_TYPES)
|
outcome = models.CharField(max_length=10, choices=OUTCOMES)
|
||||||
title_at_stake = models.BooleanField(default=False)
|
title_at_stake = models.BooleanField(default=False)
|
||||||
notes = models.TextField(blank=True, default='')
|
notes = models.TextField(blank=True, default='')
|
||||||
|
|
||||||
def record_win(self, star, win_type):
|
def record_win(self, star, outcome):
|
||||||
team = self.teams.get(members__pk=star)
|
team = self.teams.get(members__pk=star)
|
||||||
team.victorious = True
|
team.victorious = True
|
||||||
team.save()
|
team.save()
|
||||||
self.winner_id = star
|
self.winner_id = star
|
||||||
self.win_type = win_type
|
self.outcome = outcome
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def points(self):
|
def points(self):
|
||||||
@ -105,9 +106,9 @@ class Match(models.Model):
|
|||||||
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
|
||||||
if self.win_type == 'appearance' and not star.active:
|
if self.outcome == 'appearance' and not star.active:
|
||||||
points[star.id] += 10
|
points[star.id] += 10
|
||||||
if self.win_type == 'brawl':
|
if self.outcome == 'brawl':
|
||||||
points[star.id] += 2
|
points[star.id] += 2
|
||||||
if team.title:
|
if team.title:
|
||||||
title_teams[team.title] = team
|
title_teams[team.title] = team
|
||||||
@ -118,7 +119,7 @@ class Match(models.Model):
|
|||||||
team_count += 1
|
team_count += 1
|
||||||
|
|
||||||
# don't worry about winners of appearances or brawls
|
# don't worry about winners of appearances or brawls
|
||||||
if self.win_type in ('appearance', 'brawl'):
|
if self.outcome in ('appearance', 'brawl'):
|
||||||
return points
|
return points
|
||||||
|
|
||||||
if winners:
|
if winners:
|
||||||
@ -127,7 +128,7 @@ class Match(models.Model):
|
|||||||
|
|
||||||
# figure out base points for winning
|
# figure out base points for winning
|
||||||
# DQ wins are worth 1 point no matter what
|
# DQ wins are worth 1 point no matter what
|
||||||
if self.win_type == 'DQ':
|
if self.outcome == 'DQ':
|
||||||
base_points = 1
|
base_points = 1
|
||||||
allies = 0 # allies don't matter in a DQ
|
allies = 0 # allies don't matter in a DQ
|
||||||
# rumble is worth participants/2
|
# rumble is worth participants/2
|
||||||
@ -147,7 +148,7 @@ class Match(models.Model):
|
|||||||
# w/ win, give them the bonus points
|
# w/ win, give them the bonus points
|
||||||
if allies and w.id == self.winner_id:
|
if allies and w.id == self.winner_id:
|
||||||
points[w.id] += 1
|
points[w.id] += 1
|
||||||
if w.id == self.winner_id and self.win_type == 'submission':
|
if w.id == self.winner_id and self.outcome == 'submission':
|
||||||
points[w.id] += 1
|
points[w.id] += 1
|
||||||
|
|
||||||
# look over all titles in this match
|
# look over all titles in this match
|
||||||
@ -161,13 +162,13 @@ class Match(models.Model):
|
|||||||
# beat someone w/ title
|
# beat someone w/ title
|
||||||
elif winners.title != title:
|
elif winners.title != title:
|
||||||
# title win
|
# title win
|
||||||
if self.title_at_stake and self.win_type != 'DQ':
|
if self.title_at_stake and self.outcome != 'DQ':
|
||||||
if title in ('heavyweight', 'wwe'):
|
if title in ('heavyweight', 'wwe'):
|
||||||
points[w.id] += 20
|
points[w.id] += 20
|
||||||
else:
|
else:
|
||||||
points[w.id] += 10
|
points[w.id] += 10
|
||||||
# title team gets a point if they defend title by DQ
|
# title team gets a point if they defend title by DQ
|
||||||
elif self.title_at_stake and self.win_type == 'DQ':
|
elif self.title_at_stake and self.outcome == 'DQ':
|
||||||
for star in title_team.members.all():
|
for star in title_team.members.all():
|
||||||
points[star.id] += 1
|
points[star.id] += 1
|
||||||
# beat tag champs in tag match w/o tag belt on line
|
# beat tag champs in tag match w/o tag belt on line
|
||||||
|
@ -42,56 +42,56 @@ class MatchTest(TestCase):
|
|||||||
match = self.event.add_match('tripleh', 'undertaker')
|
match = self.event.add_match('tripleh', 'undertaker')
|
||||||
self.assertEqual(unicode(match),
|
self.assertEqual(unicode(match),
|
||||||
'Triple H vs. Undertaker (no contest)')
|
'Triple H vs. Undertaker (no contest)')
|
||||||
match.record_win('undertaker', 'pin')
|
match.record_win('undertaker', 'normal')
|
||||||
self.assertEqual(unicode(match), 'Triple H vs. Undertaker (v)')
|
self.assertEqual(unicode(match), 'Triple H vs. Undertaker (v)')
|
||||||
|
|
||||||
_give_belt('cmpunk', 'wwe')
|
_give_belt('cmpunk', 'wwe')
|
||||||
match = self.event.add_match('cmpunk', 'reymysterio', winner='cmpunk',
|
match = self.event.add_match('cmpunk', 'reymysterio', winner='cmpunk',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
self.assertEqual(unicode(match), 'CM Punk (c) (v) vs. Rey Mysterio')
|
self.assertEqual(unicode(match), 'CM Punk (c) (v) vs. Rey Mysterio')
|
||||||
|
|
||||||
|
|
||||||
def test_scoring(self):
|
def test_scoring(self):
|
||||||
# one on one : 2 points
|
# one on one : 2 points
|
||||||
match = self.event.add_match('tripleh', 'undertaker',
|
match = self.event.add_match('tripleh', 'undertaker',
|
||||||
winner='undertaker', win_type='pin')
|
winner='undertaker', outcome='normal')
|
||||||
self.assertEqual(match.points(), {'undertaker': 2, 'tripleh': 0})
|
self.assertEqual(match.points(), {'undertaker': 2, 'tripleh': 0})
|
||||||
|
|
||||||
# fatal 4 way: 6 points
|
# fatal 4 way: 6 points
|
||||||
match = self.event.add_match('randyorton', 'sheamus', 'albertodelrio',
|
match = self.event.add_match('randyorton', 'sheamus', 'albertodelrio',
|
||||||
'chrisjericho', winner='sheamus',
|
'chrisjericho', winner='sheamus',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
self.assertEqual(match.points(), {'sheamus': 6, 'randyorton': 0,
|
self.assertEqual(match.points(), {'sheamus': 6, 'randyorton': 0,
|
||||||
'albertodelrio': 0, 'chrisjericho': 0}
|
'albertodelrio': 0, 'chrisjericho': 0}
|
||||||
)
|
)
|
||||||
|
|
||||||
# win stacked match: 1 point for team (bonuses can apply)
|
# win stacked match: 1 point for team (bonuses can apply)
|
||||||
match = self.event.add_match('santinomarella', ['markhenry', 'kane'],
|
match = self.event.add_match('santinomarella', ['markhenry', 'kane'],
|
||||||
winner='markhenry', win_type='pin')
|
winner='markhenry', outcome='normal')
|
||||||
self.assertEqual(match.points(), {'markhenry': 2, 'kane': 1,
|
self.assertEqual(match.points(), {'markhenry': 2, 'kane': 1,
|
||||||
'santinomarella': 0})
|
'santinomarella': 0})
|
||||||
|
|
||||||
# DQ : 1 point
|
# DQ : 1 point
|
||||||
match = self.event.add_match('kane', 'undertaker', winner='undertaker',
|
match = self.event.add_match('kane', 'undertaker', winner='undertaker',
|
||||||
win_type='DQ')
|
outcome='DQ')
|
||||||
self.assertEqual(match.points(), {'undertaker': 1, 'kane': 0})
|
self.assertEqual(match.points(), {'undertaker': 1, 'kane': 0})
|
||||||
|
|
||||||
# submission: +1
|
# submission: +1
|
||||||
match = self.event.add_match('danielbryan', 'cmpunk',
|
match = self.event.add_match('danielbryan', 'cmpunk',
|
||||||
winner='danielbryan',
|
winner='danielbryan',
|
||||||
win_type='submission')
|
outcome='submission')
|
||||||
self.assertEqual(match.points(), {'danielbryan': 3, 'cmpunk': 0})
|
self.assertEqual(match.points(), {'danielbryan': 3, 'cmpunk': 0})
|
||||||
|
|
||||||
# complicated one, outnumbered + submission
|
# complicated one, outnumbered + submission
|
||||||
match = self.event.add_match('cmpunk', ['danielbryan', 'chrisjericho'],
|
match = self.event.add_match('cmpunk', ['danielbryan', 'chrisjericho'],
|
||||||
winner='cmpunk', win_type='submission')
|
winner='cmpunk', outcome='submission')
|
||||||
self.assertEqual(match.points(), {'cmpunk': 5, 'chrisjericho': 0,
|
self.assertEqual(match.points(), {'cmpunk': 5, 'chrisjericho': 0,
|
||||||
'danielbryan': 0})
|
'danielbryan': 0})
|
||||||
|
|
||||||
# tag team: 2 points, +1 for the person who made pin
|
# tag team: 2 points, +1 for the person who made pin
|
||||||
match = self.event.add_match(['kofikingston', 'rtruth'],
|
match = self.event.add_match(['kofikingston', 'rtruth'],
|
||||||
['jackswagger', 'dolphziggler'],
|
['jackswagger', 'dolphziggler'],
|
||||||
winner='dolphziggler', win_type='pin')
|
winner='dolphziggler', outcome='normal')
|
||||||
self.assertEqual(match.points(), {'jackswagger': 2,
|
self.assertEqual(match.points(), {'jackswagger': 2,
|
||||||
'dolphziggler': 3,
|
'dolphziggler': 3,
|
||||||
'kofikingston': 0,
|
'kofikingston': 0,
|
||||||
@ -101,7 +101,7 @@ class MatchTest(TestCase):
|
|||||||
match = self.event.add_match(['kofikingston', 'rtruth'],
|
match = self.event.add_match(['kofikingston', 'rtruth'],
|
||||||
['jackswagger', 'dolphziggler'],
|
['jackswagger', 'dolphziggler'],
|
||||||
winner='dolphziggler',
|
winner='dolphziggler',
|
||||||
win_type='submission')
|
outcome='submission')
|
||||||
self.assertEqual(match.points(), {'jackswagger': 2,
|
self.assertEqual(match.points(), {'jackswagger': 2,
|
||||||
'dolphziggler': 4,
|
'dolphziggler': 4,
|
||||||
'kofikingston': 0,
|
'kofikingston': 0,
|
||||||
@ -111,7 +111,7 @@ class MatchTest(TestCase):
|
|||||||
match = self.event.add_match(['kofikingston', 'rtruth'],
|
match = self.event.add_match(['kofikingston', 'rtruth'],
|
||||||
['jackswagger', 'dolphziggler'],
|
['jackswagger', 'dolphziggler'],
|
||||||
winner='dolphziggler',
|
winner='dolphziggler',
|
||||||
win_type='DQ')
|
outcome='DQ')
|
||||||
self.assertEqual(match.points(), {'jackswagger': 1,
|
self.assertEqual(match.points(), {'jackswagger': 1,
|
||||||
'dolphziggler': 1,
|
'dolphziggler': 1,
|
||||||
'kofikingston': 0,
|
'kofikingston': 0,
|
||||||
@ -122,7 +122,7 @@ class MatchTest(TestCase):
|
|||||||
'dolphziggler', 'johncena', 'jackswagger',
|
'dolphziggler', 'johncena', 'jackswagger',
|
||||||
'kharma', 'kane', 'albertodelrio',
|
'kharma', 'kane', 'albertodelrio',
|
||||||
'christian', winner='christian',
|
'christian', winner='christian',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
self.assertEqual(match.points(), {'christian': 5,
|
self.assertEqual(match.points(), {'christian': 5,
|
||||||
'kofikingston': 0,
|
'kofikingston': 0,
|
||||||
'rtruth': 0,
|
'rtruth': 0,
|
||||||
@ -138,17 +138,17 @@ class MatchTest(TestCase):
|
|||||||
def test_appearance_scoring(self):
|
def test_appearance_scoring(self):
|
||||||
# normal appearance worth 0 points
|
# normal appearance worth 0 points
|
||||||
match = self.event.add_match('cmpunk', 'kofikingston',
|
match = self.event.add_match('cmpunk', 'kofikingston',
|
||||||
win_type='appearance')
|
outcome='appearance')
|
||||||
self.assertEqual(match.points(), {'cmpunk': 0, 'kofikingston': 0})
|
self.assertEqual(match.points(), {'cmpunk': 0, 'kofikingston': 0})
|
||||||
|
|
||||||
# appearance of old timer, 10 points
|
# appearance of old timer, 10 points
|
||||||
match = self.event.add_match('brock-lesnar', win_type='appearance')
|
match = self.event.add_match('brock-lesnar', outcome='appearance')
|
||||||
self.assertEqual(match.points(), {'brock-lesnar': 10})
|
self.assertEqual(match.points(), {'brock-lesnar': 10})
|
||||||
|
|
||||||
def test_brawl_scoring(self):
|
def test_brawl_scoring(self):
|
||||||
# brawls worth 2 points for all involved
|
# brawls worth 2 points for all involved
|
||||||
match = self.event.add_match(['cmpunk', 'aj'], 'danielbryan',
|
match = self.event.add_match(['cmpunk', 'aj'], 'danielbryan',
|
||||||
win_type='brawl')
|
outcome='brawl')
|
||||||
self.assertEqual(match.points(), {'cmpunk': 2, 'aj': 2,
|
self.assertEqual(match.points(), {'cmpunk': 2, 'aj': 2,
|
||||||
'danielbryan': 2})
|
'danielbryan': 2})
|
||||||
|
|
||||||
@ -160,61 +160,61 @@ class MatchTest(TestCase):
|
|||||||
|
|
||||||
# champ doesn't get a bonus just for winning
|
# champ doesn't get a bonus just for winning
|
||||||
match = self.event.add_match('cmpunk', 'reymysterio', winner='cmpunk',
|
match = self.event.add_match('cmpunk', 'reymysterio', winner='cmpunk',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
self.assertEqual(match.points(), {'cmpunk': 2, 'reymysterio': 0})
|
self.assertEqual(match.points(), {'cmpunk': 2, 'reymysterio': 0})
|
||||||
|
|
||||||
# +2 bonus for beating a champ in a non-title match
|
# +2 bonus for beating a champ in a non-title match
|
||||||
match = self.event.add_match('cmpunk', 'reymysterio',
|
match = self.event.add_match('cmpunk', 'reymysterio',
|
||||||
winner='reymysterio', win_type='pin')
|
winner='reymysterio', outcome='normal')
|
||||||
self.assertEqual(match.points(), {'cmpunk': 0, 'reymysterio': 4})
|
self.assertEqual(match.points(), {'cmpunk': 0, 'reymysterio': 4})
|
||||||
|
|
||||||
# defending wwe belt is worth +5
|
# defending wwe belt is worth +5
|
||||||
match = self.event.add_match('cmpunk', 'reymysterio', winner='cmpunk',
|
match = self.event.add_match('cmpunk', 'reymysterio', winner='cmpunk',
|
||||||
win_type='pin', title_at_stake=True)
|
outcome='normal', title_at_stake=True)
|
||||||
self.assertEqual(match.points(), {'cmpunk': 7, 'reymysterio': 0})
|
self.assertEqual(match.points(), {'cmpunk': 7, 'reymysterio': 0})
|
||||||
|
|
||||||
# winning wwe belt
|
# winning wwe belt
|
||||||
match = self.event.add_match('cmpunk', 'reymysterio',
|
match = self.event.add_match('cmpunk', 'reymysterio',
|
||||||
winner='reymysterio', win_type='pin',
|
winner='reymysterio', outcome='normal',
|
||||||
title_at_stake=True)
|
title_at_stake=True)
|
||||||
self.assertEqual(match.points(), {'reymysterio': 22, 'cmpunk': 0})
|
self.assertEqual(match.points(), {'reymysterio': 22, 'cmpunk': 0})
|
||||||
|
|
||||||
# defending other belt is worth +3
|
# defending other belt is worth +3
|
||||||
match = self.event.add_match('christian', 'codyrhodes',
|
match = self.event.add_match('christian', 'codyrhodes',
|
||||||
winner='christian', win_type='pin',
|
winner='christian', outcome='normal',
|
||||||
title_at_stake=True)
|
title_at_stake=True)
|
||||||
self.assertEqual(match.points(), {'christian': 5, 'codyrhodes': 0})
|
self.assertEqual(match.points(), {'christian': 5, 'codyrhodes': 0})
|
||||||
|
|
||||||
# winning other belt is worth +10
|
# winning other belt is worth +10
|
||||||
match = self.event.add_match('christian', 'codyrhodes',
|
match = self.event.add_match('christian', 'codyrhodes',
|
||||||
winner='codyrhodes', win_type='pin',
|
winner='codyrhodes', outcome='normal',
|
||||||
title_at_stake=True)
|
title_at_stake=True)
|
||||||
self.assertEqual(match.points(), {'codyrhodes': 12, 'christian': 0})
|
self.assertEqual(match.points(), {'codyrhodes': 12, 'christian': 0})
|
||||||
|
|
||||||
# title non-defense (DQ/countout)
|
# title non-defense (DQ/countout)
|
||||||
match = self.event.add_match('christian', 'codyrhodes',
|
match = self.event.add_match('christian', 'codyrhodes',
|
||||||
winner='codyrhodes', win_type='DQ',
|
winner='codyrhodes', outcome='DQ',
|
||||||
title_at_stake=True)
|
title_at_stake=True)
|
||||||
self.assertEqual(match.points(), {'codyrhodes': 1, 'christian': 1})
|
self.assertEqual(match.points(), {'codyrhodes': 1, 'christian': 1})
|
||||||
|
|
||||||
# no bonus in a tag match
|
# no bonus in a tag match
|
||||||
match = self.event.add_match(['cmpunk', 'christian'],
|
match = self.event.add_match(['cmpunk', 'christian'],
|
||||||
['reymysterio', 'codyrhodes'],
|
['reymysterio', 'codyrhodes'],
|
||||||
winner='reymysterio', win_type='pin')
|
winner='reymysterio', outcome='normal')
|
||||||
self.assertEqual(match.points(), {'codyrhodes': 2, 'reymysterio': 3,
|
self.assertEqual(match.points(), {'codyrhodes': 2, 'reymysterio': 3,
|
||||||
'cmpunk': 0, 'christian': 0})
|
'cmpunk': 0, 'christian': 0})
|
||||||
|
|
||||||
# ...unless it is the tag title
|
# ...unless it is the tag title
|
||||||
match = self.event.add_match(['kofikingston', 'rtruth'],
|
match = self.event.add_match(['kofikingston', 'rtruth'],
|
||||||
['reymysterio', 'sin-cara'],
|
['reymysterio', 'sin-cara'],
|
||||||
winner='reymysterio', win_type='pin')
|
winner='reymysterio', outcome='normal')
|
||||||
self.assertEqual(match.points(), {'sin-cara': 4, 'reymysterio': 5,
|
self.assertEqual(match.points(), {'sin-cara': 4, 'reymysterio': 5,
|
||||||
'kofikingston': 0, 'rtruth': 0})
|
'kofikingston': 0, 'rtruth': 0})
|
||||||
|
|
||||||
# test tag title changing hands
|
# test tag title changing hands
|
||||||
match = self.event.add_match(['kofikingston', 'rtruth'],
|
match = self.event.add_match(['kofikingston', 'rtruth'],
|
||||||
['reymysterio', 'sin-cara'],
|
['reymysterio', 'sin-cara'],
|
||||||
winner='reymysterio', win_type='pin',
|
winner='reymysterio', outcome='normal',
|
||||||
title_at_stake=True)
|
title_at_stake=True)
|
||||||
self.assertEqual(match.points(), {'sin-cara': 12, 'reymysterio': 13,
|
self.assertEqual(match.points(), {'sin-cara': 12, 'reymysterio': 13,
|
||||||
'kofikingston': 0, 'rtruth': 0})
|
'kofikingston': 0, 'rtruth': 0})
|
||||||
@ -249,12 +249,12 @@ class LeagueTest(TestCase):
|
|||||||
self.johnny.add_star(pk='markhenry')
|
self.johnny.add_star(pk='markhenry')
|
||||||
event = Event.objects.create(name='smackdown', date='2012-01-01')
|
event = Event.objects.create(name='smackdown', date='2012-01-01')
|
||||||
match1 = event.add_match('reymysterio', 'sin-cara', winner='sin-cara',
|
match1 = event.add_match('reymysterio', 'sin-cara', winner='sin-cara',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
match2 = event.add_match('markhenry', ['santinomarella', 'mickfoley'],
|
match2 = event.add_match('markhenry', ['santinomarella', 'mickfoley'],
|
||||||
winner='mickfoley', win_type='pin')
|
winner='mickfoley', outcome='normal')
|
||||||
_give_belt('codyrhodes', 'ic')
|
_give_belt('codyrhodes', 'ic')
|
||||||
match3 = event.add_match('sin-cara', 'codyrhodes', title_at_stake=True,
|
match3 = event.add_match('sin-cara', 'codyrhodes', title_at_stake=True,
|
||||||
winner='sin-cara', win_type='pin')
|
winner='sin-cara', outcome='normal')
|
||||||
self.league.score_event(event)
|
self.league.score_event(event)
|
||||||
|
|
||||||
# check TeamPoints objects
|
# check TeamPoints objects
|
||||||
|
@ -23,92 +23,97 @@ gm_punk = Team.objects.create(name='GM Punk', login=james, league=league)
|
|||||||
awesome = Team.objects.create(name="I'm AWEsome!", login=kevin, league=league)
|
awesome = Team.objects.create(name="I'm AWEsome!", login=kevin, league=league)
|
||||||
cobra = Team.objects.create(name='COBRA!', login=erin, league=league)
|
cobra = Team.objects.create(name='COBRA!', login=erin, league=league)
|
||||||
|
|
||||||
punks = ('cmpunk', 'markhenry', 'rtruth', 'codyrhodes', 'tensai', 'antoniocesaro',
|
punks = ('cmpunk', 'markhenry', 'rtruth', 'codyrhodes',
|
||||||
'wadebarrett', 'aj', 'bethphoenix')
|
'tensai', 'antoniocesaro', 'wadebarrett', 'aj', 'bethphoenix',
|
||||||
|
'brock-lesnar', 'mickfoley')
|
||||||
for person in punks:
|
for person in punks:
|
||||||
gm_punk.add_star(pk=person)
|
gm_punk.add_star(pk=person)
|
||||||
|
|
||||||
awesomes = ('chrisjericho', 'sheamus', 'danielbryan', 'ryback', 'damien-sandow',
|
awesomes = ('chrisjericho', 'sheamus', 'danielbryan', 'ryback', 'damien-sandow',
|
||||||
'kharma', 'kellykelly', 'brodusclay', 'johncena')
|
'kharma', 'kellykelly', 'brodusclay', 'johncena',
|
||||||
|
'paulheyman', 'paulbearer')
|
||||||
for person in awesomes:
|
for person in awesomes:
|
||||||
awesome.add_star(pk=person)
|
awesome.add_star(pk=person)
|
||||||
|
|
||||||
cobras = ('santinomarella', 'dolphziggler', 'kofikingston', 'albertodelrio',
|
cobras = ('santinomarella', 'dolphziggler', 'kofikingston', 'albertodelrio',
|
||||||
'randyorton', 'bigshow', 'titusoneil', 'layla', 'natalya')
|
'randyorton', 'bigshow', 'titusoneil', 'layla', 'natalya',
|
||||||
|
'edge', 'jimross')
|
||||||
for person in cobras:
|
for person in cobras:
|
||||||
cobra.add_star(pk=person)
|
cobra.add_star(pk=person)
|
||||||
|
|
||||||
# RAW 5/14
|
# RAW 5/14
|
||||||
event = Event.objects.create(name='RAW', date='2012-05-14')
|
event = Event.objects.create(name='RAW', date='2012-05-14')
|
||||||
event.add_match(['cmpunk', 'santinomarella'], ['codyrhodes', 'danielbryan'],
|
event.add_match(['cmpunk', 'santinomarella'], ['codyrhodes', 'danielbryan'],
|
||||||
winner='cmpunk', win_type='pin')
|
winner='cmpunk', outcome='normal')
|
||||||
event.add_match('aliciafox', 'bethphoenix', winner='bethphoenix',
|
event.add_match('aliciafox', 'bethphoenix', winner='bethphoenix',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
event.add_match('bigshow', 'kane', winner='kane', win_type='pin')
|
event.add_match('bigshow', 'kane', winner='kane', outcome='normal')
|
||||||
event.add_match(['brodusclay', 'kofikingston', 'rtruth'],
|
event.add_match(['brodusclay', 'kofikingston', 'rtruth'],
|
||||||
['themiz', 'jackswagger', 'dolphziggler'],
|
['themiz', 'jackswagger', 'dolphziggler'],
|
||||||
winner='brodusclay', win_type='pin')
|
winner='brodusclay', outcome='normal')
|
||||||
event.add_match('chrisjericho', 'randyorton',
|
event.add_match('chrisjericho', 'randyorton',
|
||||||
winner='chrisjericho', win_type='DQ',
|
winner='chrisjericho', outcome='DQ',
|
||||||
note='Sheamus interfered, giving Jericho the win')
|
notes='Sheamus interfered, giving Jericho the win')
|
||||||
# MISSING heyman's appearance
|
event.add_match('paulheyman', outcome='appearance',
|
||||||
|
notes='Paul Heyman is going to sue for Bork Laser')
|
||||||
league.score_event(event)
|
league.score_event(event)
|
||||||
|
|
||||||
# Smackdown 5/18
|
# Smackdown 5/18
|
||||||
event = Event.objects.create(name='Smackdown', date='2012-05-18')
|
event = Event.objects.create(name='Smackdown', date='2012-05-18')
|
||||||
event.add_match(['kofikingston', 'rtruth'], ['darrenyoung', 'titusoneil'],
|
event.add_match(['kofikingston', 'rtruth'], ['darrenyoung', 'titusoneil'],
|
||||||
winner='rtruth', win_type='pin')
|
winner='rtruth', outcome='normal')
|
||||||
event.add_match('damien-sandow', 'yoshitatsu', notes='sandow refuses to fight')
|
event.add_match('damien-sandow', 'yoshitatsu',
|
||||||
|
outcome='brawl',
|
||||||
|
notes='sandow refuses to fight, leads to a brawl')
|
||||||
event.add_match('zackryder', 'danielbryan', winner='danielbryan',
|
event.add_match('zackryder', 'danielbryan', winner='danielbryan',
|
||||||
win_type='submission')
|
outcome='submission')
|
||||||
event.add_match('cmpunk', 'kane', winner='kane', win_type='dq',
|
event.add_match('cmpunk', 'kane', winner='kane', outcome='dq',
|
||||||
notes='bryan hits kane with a chair, kane wins by DQ')
|
notes='bryan hits kane with a chair, kane wins by DQ')
|
||||||
event.add_match('santinomarella', 'codyrhodes', winner='santinomarella',
|
event.add_match('santinomarella', 'codyrhodes', winner='santinomarella',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
event.add_match('randyorton', 'sheamus', winner='sheamus', win_type='pin')
|
event.add_match('randyorton', 'sheamus', winner='sheamus', outcome='normal')
|
||||||
# MISSING sandow brawl points
|
|
||||||
league.score_event(event)
|
league.score_event(event)
|
||||||
|
|
||||||
# Over the Limit 5/20
|
# Over the Limit 5/20
|
||||||
event = Event.objects.create(name='Over the Limit', date='2012-05-20')
|
event = Event.objects.create(name='Over the Limit', date='2012-05-20')
|
||||||
event.add_match('zackryder', 'kane', winner='kane', win_type='pin')
|
event.add_match('zackryder', 'kane', winner='kane', outcome='normal')
|
||||||
event.add_match('alexriley', 'christian', 'curthawkins', 'darrenyoung',
|
event.add_match('alexriley', 'christian', 'curthawkins', 'darrenyoung',
|
||||||
'davidotunga', 'drewmcintyre', 'ezekieljackson',
|
'davidotunga', 'drewmcintyre', 'ezekieljackson',
|
||||||
'thegreatkhali', 'heathslater', 'jeyuso', 'jimmyuso', 'jindermahal',
|
'thegreatkhali', 'heathslater', 'jeyuso', 'jimmyuso', 'jindermahal',
|
||||||
'jtg', 'michaelmcgillicutty', 'themiz', 'titusoneil',
|
'jtg', 'michaelmcgillicutty', 'themiz', 'titusoneil',
|
||||||
'tylerreks', 'tysonkidd', 'williamregal', 'yoshitatsu',
|
'tylerreks', 'tysonkidd', 'williamregal', 'yoshitatsu',
|
||||||
winner='christian', win_type='pin')
|
winner='christian', outcome='normal')
|
||||||
event.add_match(['kofikingston', 'rtruth'], ['dolphziggler', 'jackswagger'],
|
event.add_match(['kofikingston', 'rtruth'], ['dolphziggler', 'jackswagger'],
|
||||||
winner='kofikingston', win_type='pin', title_at_stake=True)
|
winner='kofikingston', outcome='normal', title_at_stake=True)
|
||||||
event.add_match('layla', 'bethphoenix', winner='layla',
|
event.add_match('layla', 'bethphoenix', winner='layla',
|
||||||
win_type='pin', title_at_stake=True)
|
outcome='normal', title_at_stake=True)
|
||||||
event.add_match('sheamus', 'randyorton', 'chrisjericho', 'albertodelrio',
|
event.add_match('sheamus', 'randyorton', 'chrisjericho', 'albertodelrio',
|
||||||
winner='sheamus', win_type='pin', title_at_stake=True)
|
winner='sheamus', outcome='normal', title_at_stake=True)
|
||||||
event.add_match('brodusclay', 'themiz', winner='brodusclay', win_type='pin')
|
event.add_match('brodusclay', 'themiz', winner='brodusclay', outcome='normal')
|
||||||
event.add_match('christian', 'codyrhodes', winner='christian', win_type='pin',
|
event.add_match('christian', 'codyrhodes', winner='christian', outcome='normal',
|
||||||
title_at_stake=True)
|
title_at_stake=True)
|
||||||
_give_belt('christian', 'ic')
|
_give_belt('christian', 'ic')
|
||||||
event.add_match('cmpunk', 'danielbryan', winner='cmpunk', win_type='pin',
|
event.add_match('cmpunk', 'danielbryan', winner='cmpunk', outcome='normal',
|
||||||
title_at_stake=True)
|
title_at_stake=True)
|
||||||
event.add_match('ryback', 'camacho', winner='ryback', win_type='pin')
|
event.add_match('ryback', 'camacho', winner='ryback', outcome='normal')
|
||||||
event.add_match('john-laurinaitis', 'johncena', 'bigshow',
|
event.add_match('john-laurinaitis', 'johncena', 'bigshow',
|
||||||
winner='john-laurinaitis',
|
winner='john-laurinaitis',
|
||||||
win_type='pin', notes='Big Show interferes in a big way')
|
outcome='normal', notes='Big Show interferes in a big way')
|
||||||
league.score_event(event)
|
league.score_event(event)
|
||||||
|
|
||||||
# 5/21 RAW
|
# 5/21 RAW
|
||||||
event = Event.objects.create(name='RAW', date='2012-05-21')
|
event = Event.objects.create(name='RAW', date='2012-05-21')
|
||||||
event.add_match('davidotunga', 'johncena', winner='johncena',
|
event.add_match('davidotunga', 'johncena', winner='johncena',
|
||||||
win_type='submission')
|
outcome='submission')
|
||||||
# Brawl: Tyler Reks & Curt Hawkins & Titus O'Neil & Daren Young & Sheamus
|
# Brawl: Tyler Reks & Curt Hawkins & Titus O'Neil & Daren Young & Sheamus
|
||||||
# Brawl: Santino vs. Ricardo
|
# Brawl: Santino vs. Ricardo
|
||||||
event.add_match('albertodelrio', 'randyorton', winner='randyorton',
|
event.add_match('albertodelrio', 'randyorton', winner='randyorton',
|
||||||
win_type='DQ', notes='Jericho codebreaks RKO, Orton wins')
|
outcome='DQ', notes='Jericho codebreaks RKO, Orton wins')
|
||||||
event.add_match('danielbryan', 'kane', winner='danielbryan', win_type='DQ',
|
event.add_match('danielbryan', 'kane', winner='danielbryan', outcome='DQ',
|
||||||
notes='Kane uses chair, Bryan wins')
|
notes='Kane uses chair, Bryan wins')
|
||||||
event.add_match('christian', 'jindermahal', winner='christian', win_type='pin')
|
event.add_match('christian', 'jindermahal', winner='christian', outcome='normal')
|
||||||
event.add_match('bethphoenix', 'kellykelly', winner='bethphoenix',
|
event.add_match('bethphoenix', 'kellykelly', winner='bethphoenix',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
event.add_match(['johncena', 'sheamus'],
|
event.add_match(['johncena', 'sheamus'],
|
||||||
['tensai', 'jackswagger', 'dolphziggler'],
|
['tensai', 'jackswagger', 'dolphziggler'],
|
||||||
notes='Lumberjacks rush ring, no contest')
|
notes='Lumberjacks rush ring, no contest')
|
||||||
@ -126,23 +131,23 @@ gm_punk.add_star('kane')
|
|||||||
# 5/25 Smackdown
|
# 5/25 Smackdown
|
||||||
event = Event.objects.create(name='Smackdown', date='2012-05-25')
|
event = Event.objects.create(name='Smackdown', date='2012-05-25')
|
||||||
event.add_match('christian', 'hunico', winner='christian',
|
event.add_match('christian', 'hunico', winner='christian',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
event.add_match(['titusoneil', 'darrenyoung'],
|
event.add_match(['titusoneil', 'darrenyoung'],
|
||||||
['jimmyuso', 'jeyuso'],
|
['jimmyuso', 'jeyuso'],
|
||||||
winner='titusoneil', win_type='pin')
|
winner='titusoneil', outcome='normal')
|
||||||
Star.objects.create(name='Nobody One', pk='nobody1')
|
Star.objects.create(name='Nobody One', pk='nobody1')
|
||||||
Star.objects.create(name='Nobody Two', pk='nobody2')
|
Star.objects.create(name='Nobody Two', pk='nobody2')
|
||||||
event.add_match('ryback',
|
event.add_match('ryback',
|
||||||
['nobody1', 'nobody2'], winner='ryback',
|
['nobody1', 'nobody2'], winner='ryback',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
event.add_match('santinomarella', 'ricardorodriguez',
|
event.add_match('santinomarella', 'ricardorodriguez',
|
||||||
winner='santinomarella', win_type='pin')
|
winner='santinomarella', outcome='normal')
|
||||||
event.add_match('sheamus', 'jackswagger', winner='sheamus',
|
event.add_match('sheamus', 'jackswagger', winner='sheamus',
|
||||||
win_type='pin')
|
outcome='normal')
|
||||||
event.add_match('damien-sandow', 'yoshitatsu',
|
event.add_match('damien-sandow', 'yoshitatsu',
|
||||||
winner='damien-sandow', win_type='pin')
|
winner='damien-sandow', outcome='normal')
|
||||||
# daniel bryan vs kane brawl
|
# daniel bryan vs kane brawl
|
||||||
event.add_match('randyorton', 'kane', 'albertodelrio',
|
event.add_match('randyorton', 'kane', 'albertodelrio',
|
||||||
winner='albertodelrio', win_type='pin')
|
winner='albertodelrio', outcome='normal')
|
||||||
league.score_event(event)
|
league.score_event(event)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user