30 lines
763 B
Python
30 lines
763 B
Python
from django.contrib import admin
|
|
|
|
from music.models import Track, Album, Artist
|
|
|
|
|
|
@admin.register(Track)
|
|
class TrackAdmin(admin.ModelAdmin):
|
|
class Media:
|
|
js = ('admin/js/upload_progress.js',)
|
|
css = {
|
|
'all': ('admin/css/upload_progress.css',)
|
|
}
|
|
|
|
list_display = ("artist__name", "title", "created_by", "created_at")
|
|
search_fields = ("title", "artist__name", "album__name")
|
|
list_filter = ("artist__name",)
|
|
|
|
|
|
@admin.register(Album)
|
|
class AlbumAdmin(admin.ModelAdmin):
|
|
list_display = ("artist__name", "name")
|
|
search_fields = ("artist__name", "name")
|
|
list_filter = ("artist__name",)
|
|
|
|
|
|
@admin.register(Artist)
|
|
class ArtistAdmin(admin.ModelAdmin):
|
|
list_display = ("name",)
|
|
search_fields = ("name",)
|