Skip to content

Instantly share code, notes, and snippets.

@debuggerpk
Created March 9, 2012 20:01
Show Gist options
  • Save debuggerpk/2008359 to your computer and use it in GitHub Desktop.
Save debuggerpk/2008359 to your computer and use it in GitHub Desktop.
for fahdie
class InningsCard(models.Model):
fixture = models.ForeignKey(Fixture)
team = models.ForeignKey(Team)
runs = models.IntegerField(max_length=6, default=0)
wickets = models.IntegerField(max_length=6, default=0)
overs = models.FloatField(max_length=6, default=0.0)
def __unicode__(self):
return str(self.team)
class BattingDetail(models.Model):
STATUS_CHOICES = (
('no', 'not out'),
('bowled', 'bowled'),
('caught', 'caught'),
('lbw', 'lbw'),
)
innings = models.ForeignKey(InningsCard)
player = models.ForeignKey(Player)
runs = models.IntegerField(max_length=5, default=0)
status = models.CharField(max_length=15, choices=STATUS_CHOICES, default='no')
def __unicode__(self):
return str(self.player)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment