add drop_player and smackdown from last friday
This commit is contained in:
parent
d9cd2a1dcd
commit
0c83377415
2
TODO
Normal file
2
TODO
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
* actually have belts change hands when title is on the line in a match
|
||||||
|
* ability to add bonuses
|
@ -69,13 +69,17 @@ class Team(models.Model):
|
|||||||
league = models.ForeignKey(League, related_name='teams')
|
league = models.ForeignKey(League, related_name='teams')
|
||||||
stars = models.ManyToManyField(Star, related_name='teams')
|
stars = models.ManyToManyField(Star, related_name='teams')
|
||||||
|
|
||||||
def add_star(self, **kwargs):
|
def add_star(self, pk):
|
||||||
member = Star.objects.get(**kwargs)
|
member = Star.objects.get(pk=pk)
|
||||||
if member.drafted(self.league):
|
if member.drafted(self.league):
|
||||||
raise ValueError('cannot add {0}, already drafted in {1}'.format(
|
raise ValueError('cannot add {0}, already drafted in {1}'.format(
|
||||||
member, self.league))
|
member, self.league))
|
||||||
self.stars.add(member)
|
self.stars.add(member)
|
||||||
|
|
||||||
|
def drop_star(self, pk):
|
||||||
|
member = Star.objects.get(pk=pk)
|
||||||
|
self.stars.remove(member)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@ -114,8 +114,35 @@ event.add_match(['johncena', 'sheamus'],
|
|||||||
notes='Lumberjacks rush ring, no contest')
|
notes='Lumberjacks rush ring, no contest')
|
||||||
league.score_event(event)
|
league.score_event(event)
|
||||||
|
|
||||||
# GM Punk
|
# COBRA! draft actions
|
||||||
# drop mark henry for sin cara
|
cobra.drop_star('titusoneil')
|
||||||
# drop tensai for kane
|
cobra.add_star('christian')
|
||||||
# COBRA!
|
# GM Punk draft actions
|
||||||
# drop titus o'neil and add christian
|
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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user