From: David ‘Bombe’ Roden Date: Fri, 10 May 2013 23:31:47 +0000 (+0200) Subject: Add style to tracks. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=8dcf17a69f7713b9fde67a5ec88e5e394dd7fbee;p=demoscenemusic.git Add style to tracks. --- diff --git a/data/admin.py b/data/admin.py index d957b22..5a3f9c3 100644 --- a/data/admin.py +++ b/data/admin.py @@ -18,10 +18,11 @@ class RemixArtistInline(admin.TabularInline): 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) diff --git a/data/models.py b/data/models.py index 482e987..da15ab5 100644 --- a/data/models.py +++ b/data/models.py @@ -62,9 +62,16 @@ class RemixArtist(models.Model): 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)