Mercurial > public > madeira
annotate mp3/admin.py @ 130:3062c547bb90
For Django 1.6: new test discovery plus reverse now does urlquote().
My base64 keys were padded with '=' and these got quoted when doing
a reverse to generate the URL. So changed the test to look for a
quoted version of the key. This will change the URLs sent to users, but
I believe it will all be taken care of by Django.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 24 Dec 2013 16:47:27 -0600 |
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) |