annotate videos/admin.py @ 140:fbdcb7b80a16

Add GP article to home page.
author Brian Neal <bgneal@gmail.com>
date Sun, 23 Mar 2014 17:47:21 -0500
parents e2868ad47a1e
children
rev   line source
bgneal@50 1 """
bgneal@50 2 Automatic admin definitions for the models in the videos application.
bgneal@50 3
bgneal@50 4 """
bgneal@50 5 from django.contrib import admin
bgneal@50 6 from django.conf import settings
bgneal@50 7
bgneal@50 8 from videos.models import Collection, Video
bgneal@50 9
bgneal@50 10
bgneal@50 11 class VideoInline(admin.StackedInline):
bgneal@50 12 model = Video
bgneal@50 13
bgneal@50 14
bgneal@50 15 class CollectionAdmin(admin.ModelAdmin):
bgneal@50 16 list_filter = ['date_added']
bgneal@50 17 list_display = ['title', 'date_added']
bgneal@50 18 inlines = [VideoInline]
bgneal@50 19
bgneal@50 20 class Media:
bgneal@50 21 js = ['js/videos/videos_admin.js'] + settings.THIRD_PARTY_JS['tiny_mce']
bgneal@50 22
bgneal@50 23
bgneal@50 24 class VideoAdmin(admin.ModelAdmin):
bgneal@50 25 list_display = ['title', 'collection']
bgneal@50 26
bgneal@50 27
bgneal@50 28 admin.site.register(Collection, CollectionAdmin)
bgneal@50 29 admin.site.register(Video, VideoAdmin)