bgneal@50: """ bgneal@50: Automatic admin definitions for the models in the videos application. bgneal@50: bgneal@50: """ bgneal@50: from django.contrib import admin bgneal@50: from django.conf import settings bgneal@50: bgneal@50: from videos.models import Collection, Video bgneal@50: bgneal@50: bgneal@50: class VideoInline(admin.StackedInline): bgneal@50: model = Video bgneal@50: bgneal@50: bgneal@50: class CollectionAdmin(admin.ModelAdmin): bgneal@50: list_filter = ['date_added'] bgneal@50: list_display = ['title', 'date_added'] bgneal@50: inlines = [VideoInline] bgneal@50: bgneal@50: class Media: bgneal@50: js = ['js/videos/videos_admin.js'] + settings.THIRD_PARTY_JS['tiny_mce'] bgneal@50: bgneal@50: bgneal@50: class VideoAdmin(admin.ModelAdmin): bgneal@50: list_display = ['title', 'collection'] bgneal@50: bgneal@50: bgneal@50: admin.site.register(Collection, CollectionAdmin) bgneal@50: admin.site.register(Video, VideoAdmin)