bgneal@48: """ bgneal@48: Automatic admin definitions for the models in the mp3 application. bgneal@48: bgneal@48: """ bgneal@48: from django.contrib import admin bgneal@48: from django.conf import settings bgneal@48: bgneal@48: from mp3.models import Collection, Song bgneal@48: bgneal@48: bgneal@48: class SongInline(admin.TabularInline): bgneal@48: model = Song bgneal@48: bgneal@48: bgneal@48: class CollectionAdmin(admin.ModelAdmin): bgneal@48: list_filter = ['date_added'] bgneal@48: list_display = ['title', 'date_added'] bgneal@48: inlines = [SongInline] bgneal@48: bgneal@48: class Media: bgneal@48: js = settings.THIRD_PARTY_JS['tiny_mce'] bgneal@48: bgneal@48: bgneal@48: class SongAdmin(admin.ModelAdmin): bgneal@48: list_display = ['title', 'collection'] bgneal@48: bgneal@48: bgneal@48: admin.site.register(Collection, CollectionAdmin) bgneal@48: admin.site.register(Song, SongAdmin)