comparison videos/admin.py @ 71:e2868ad47a1e

For Django 1.4, using the new manage.py.
author Brian Neal <bgneal@gmail.com>
date Sat, 14 Apr 2012 16:40:29 -0500
parents madeira/videos/admin.py@5913ddcebea4
children
comparison
equal deleted inserted replaced
70:f26cdda0ad8b 71:e2868ad47a1e
1 """
2 Automatic admin definitions for the models in the videos application.
3
4 """
5 from django.contrib import admin
6 from django.conf import settings
7
8 from videos.models import Collection, Video
9
10
11 class VideoInline(admin.StackedInline):
12 model = Video
13
14
15 class CollectionAdmin(admin.ModelAdmin):
16 list_filter = ['date_added']
17 list_display = ['title', 'date_added']
18 inlines = [VideoInline]
19
20 class Media:
21 js = ['js/videos/videos_admin.js'] + settings.THIRD_PARTY_JS['tiny_mce']
22
23
24 class VideoAdmin(admin.ModelAdmin):
25 list_display = ['title', 'collection']
26
27
28 admin.site.register(Collection, CollectionAdmin)
29 admin.site.register(Video, VideoAdmin)