Mercurial > public > madeira
annotate videos/admin.py @ 95:7b52e8ef01ec
For Django 1.5: Remove usage of django.contrib.markup.
Since we were only using Textile in one place, decided to stop using it
altogether.
Wrote a management command, untextile, to convert the gallery models'
description fields from textile to raw HTML. This should be run one time before
going live with Django 1.5.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 28 Aug 2013 19:22:23 -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) |