Order track artists by the given order.
[demoscenemusic.git] / data / admin.py
1 from DemosceneMusic.data.models import *
2 from django.contrib import admin
3
4 admin.site.register(Artist)
5 admin.site.register(Group)
6 admin.site.register(Party)
7 admin.site.register(Compo)
8 admin.site.register(Release)
9 admin.site.register(File)
10
11 class TrackArtistInline(admin.TabularInline):
12         model = TrackArtist
13         extra = 1
14
15 class RemixArtistInline(admin.TabularInline):
16         model = RemixArtist
17         extra = 1
18
19 class TrackAdmin(admin.ModelAdmin):
20         fieldsets = [
21                 (None, {'fields': ['name', 'length']}),
22                 ('Remix Information', {'fields': ['remix'], 'classes': ['collapse']}),
23                 ('Release Information', {'fields': ['releases']}),
24         ]
25         inlines = [TrackArtistInline, RemixArtistInline]
26
27 admin.site.register(Track, TrackAdmin)