Ticket #7813: models.py

File models.py, 923 bytes (added by Ed Menendez <ed@…>, 16 years ago)

Example model

Line 
1class LeagueSeason(models.Model):
2 is_conference_used = models.BooleanField(default=False)
3 is_division_used = models.BooleanField(default=False)
4
5class LeagueConference(models.Model):
6 league_season = models.ForeignKey(LeagueSeason)
7 name = models.CharField(max_length=50)
8 # slug is not unique by itself.
9 slug = models.CharField(max_length=50,prepopulate_from=('name',), db_index=True)
10 sort_order = models.SmallIntegerField(default=1)
11
12class LeagueDivision(models.Model):
13 league_conference = models.ForeignKey(LeagueConference)
14 name = models.CharField(max_length=50)
15 # slug is not unique by itself.
16 slug = models.CharField(max_length=50,prepopulate_from=('name',), db_index=True)
17 sort_order = models.SmallIntegerField(default=1)
18
Back to Top