add drop_player and smackdown from last friday

This commit is contained in:
James Turk 2012-05-27 17:28:39 -04:00
parent d9cd2a1dcd
commit 0c83377415
3 changed files with 40 additions and 7 deletions

2
TODO Normal file
View File

@ -0,0 +1,2 @@
* actually have belts change hands when title is on the line in a match
* ability to add bonuses

View File

@ -69,13 +69,17 @@ class Team(models.Model):
league = models.ForeignKey(League, related_name='teams')
stars = models.ManyToManyField(Star, related_name='teams')
def add_star(self, **kwargs):
member = Star.objects.get(**kwargs)
def add_star(self, pk):
member = Star.objects.get(pk=pk)
if member.drafted(self.league):
raise ValueError('cannot add {0}, already drafted in {1}'.format(
member, self.league))
self.stars.add(member)
def drop_star(self, pk):
member = Star.objects.get(pk=pk)
self.stars.remove(member)
def __unicode__(self):
return self.name

View File

@ -114,8 +114,35 @@ event.add_match(['johncena', 'sheamus'],
notes='Lumberjacks rush ring, no contest')
league.score_event(event)
# GM Punk
# drop mark henry for sin cara
# drop tensai for kane
# COBRA!
# drop titus o'neil and add christian
# COBRA! draft actions
cobra.drop_star('titusoneil')
cobra.add_star('christian')
# GM Punk draft actions
gm_punk.drop_star('markhenry')
gm_punk.add_star('sin-cara')
gm_punk.drop_star('tensai')
gm_punk.add_star('kane')
# 5/25 Smackdown
event = Event.objects.create(name='Smackdown', date='2012-05-25')
event.add_match('christian', 'hunico', winner='christian',
win_type='pin')
event.add_match(['titusoneil', 'darrenyoung'],
['jimmyuso', 'jeyuso'],
winner='titusoneil', win_type='pin')
Star.objects.create(name='Nobody One', pk='nobody1')
Star.objects.create(name='Nobody Two', pk='nobody2')
event.add_match('ryback',
['nobody1', 'nobody2'], winner='ryback',
win_type='pin')
event.add_match('santinomarella', 'ricardorodriguez',
winner='santinomarella', win_type='pin')
event.add_match('sheamus', 'jackswagger', winner='sheamus',
win_type='pin')
event.add_match('damien-sandow', 'yoshitatsu',
winner='damien-sandow', win_type='pin')
# daniel bryan vs kane brawl
event.add_match('randyorton', 'kane', 'albertodelrio',
winner='albertodelrio', win_type='pin')
league.score_event(event)