From 0c83377415eb4875f1b42f17dc396a5241cdd36b Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 27 May 2012 17:28:39 -0400 Subject: [PATCH] add drop_player and smackdown from last friday --- TODO | 2 ++ fowl/game/models.py | 8 ++++++-- setup_league.py | 37 ++++++++++++++++++++++++++++++++----- 3 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 TODO diff --git a/TODO b/TODO new file mode 100644 index 0000000..bd0919b --- /dev/null +++ b/TODO @@ -0,0 +1,2 @@ +* actually have belts change hands when title is on the line in a match +* ability to add bonuses diff --git a/fowl/game/models.py b/fowl/game/models.py index 66e3b5e..e31d83b 100644 --- a/fowl/game/models.py +++ b/fowl/game/models.py @@ -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 diff --git a/setup_league.py b/setup_league.py index 10f9c76..d3c4899 100644 --- a/setup_league.py +++ b/setup_league.py @@ -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) +