class TrackAdmin(admin.ModelAdmin):
fieldsets = [
- (None, {'fields': ['name', 'length']}),
+ (None, {'fields': ['name', 'length', 'styles']}),
('Remix Information', {'fields': ['remix'], 'classes': ['collapse']}),
('Release Information', {'fields': ['releases']}),
]
inlines = [TrackArtistInline, RemixArtistInline]
+admin.site.register(Style)
admin.site.register(Track, TrackAdmin)
class Meta:
ordering = ['order']
+class Style(models.Model):
+ name = models.CharField(max_length = 80)
+
+ def __unicode__(self):
+ return self.name
+
class Track(models.Model):
name = models.CharField(max_length = 150)
artists = models.ManyToManyField(Artist, through = TrackArtist)
+ styles = models.ManyToManyField(Style, blank = True)
remix = models.CharField(max_length = 80, blank = True)
remixArtists = models.ManyToManyField(Artist, through = RemixArtist, related_name = 'remixTracks')
releases = models.ManyToManyField(Release)