rendered paste body# This is the Sports appfrom django.db import modelsimport datetimeclass Season(models.Model): name = models.CharField('season name', maxlength=255) slug = models.SlugField(prepopulate_from=("name",), help_text='Automatically created from headline.') def __str__(self): return self.name class Meta: ordering = ('name',) class Admin: pass class Sport(models.Model): name = models.CharField(maxlength=255) slug = models.SlugField( 'Slug', prepopulate_from=("name",), help_text='Automatically created from name.', ) def __str__(self): return self.name class Meta: ordering = ('name',) class Admin: fields = ( ('Sport Information', {'fields': ('name', 'slug')}), ) ordering = ('name',)# This is the Schedule appfrom django.db import modelsfrom athletics.sports.models import Season, Sportclass Game(models.Model): season = models.ForeignKey(Season) sport = models.ForeignKey(Sport) opponent = models.CharField(maxlength=255) detail = models.CharField(maxlength=255, null=True, blank=True) datetime = models.DateTimeField() statsurl = models.CharField(maxlength=255, null=True, blank=True) location = models.CharField(maxlength=255) results = models.CharField(maxlength=255, null=True, blank=True) results_url = models.CharField(maxlength=255, null=True, blank=True) def __str__(self): return self.opponent class Admin: fields = ( ('Sport Information', {'fields': ('season', 'sport',)}), ('Game Information', {'fields': ('datetime', 'opponent', 'detail', 'statsurl', 'location',)}), ('Results', {'fields': ('results', 'results_url',)}), ) list_display = ('opponent', 'season', 'sport', 'datetime',) list_filter = ['sport', 'season', 'opponent'] date_hierarchy = 'datetime' ordering = ('-datetime',)