Add style to tracks.
authorDavid ‘Bombe’ Roden <bombe@demoscenemusic.org>
Fri, 10 May 2013 23:31:47 +0000 (01:31 +0200)
committerDavid ‘Bombe’ Roden <bombe@demoscenemusic.org>
Fri, 10 May 2013 23:31:47 +0000 (01:31 +0200)
data/admin.py
data/models.py

index d957b22..5a3f9c3 100644 (file)
@@ -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)
index 482e987..da15ab5 100644 (file)
@@ -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)