annotate mp3/admin.py @ 72:e882e1c9f0c0

Update requirements.txt for Django 1.4.
author Brian Neal <bgneal@gmail.com>
date Sat, 14 Apr 2012 17:13:10 -0500
parents e2868ad47a1e
children
rev   line source
bgneal@48 1 """
bgneal@48 2 Automatic admin definitions for the models in the mp3 application.
bgneal@48 3
bgneal@48 4 """
bgneal@48 5 from django.contrib import admin
bgneal@48 6 from django.conf import settings
bgneal@48 7
bgneal@48 8 from mp3.models import Collection, Song
bgneal@48 9
bgneal@48 10
bgneal@48 11 class SongInline(admin.TabularInline):
bgneal@48 12 model = Song
bgneal@48 13
bgneal@48 14
bgneal@48 15 class CollectionAdmin(admin.ModelAdmin):
bgneal@48 16 list_filter = ['date_added']
bgneal@48 17 list_display = ['title', 'date_added']
bgneal@48 18 inlines = [SongInline]
bgneal@48 19
bgneal@48 20 class Media:
bgneal@48 21 js = settings.THIRD_PARTY_JS['tiny_mce']
bgneal@48 22
bgneal@48 23
bgneal@48 24 class SongAdmin(admin.ModelAdmin):
bgneal@48 25 list_display = ['title', 'collection']
bgneal@48 26
bgneal@48 27
bgneal@48 28 admin.site.register(Collection, CollectionAdmin)
bgneal@48 29 admin.site.register(Song, SongAdmin)