Mercurial > public > madeira
annotate news/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@45 | 1 """ |
bgneal@45 | 2 Automatic admin definitions for the models in the news application. |
bgneal@45 | 3 |
bgneal@45 | 4 """ |
bgneal@45 | 5 from django.contrib import admin |
bgneal@45 | 6 from django.conf import settings |
bgneal@45 | 7 |
bgneal@45 | 8 from news.models import News |
bgneal@45 | 9 |
bgneal@45 | 10 |
bgneal@45 | 11 class NewsAdmin(admin.ModelAdmin): |
bgneal@45 | 12 list_filter = ['date'] |
bgneal@45 | 13 search_fields = ['title', 'content'] |
bgneal@45 | 14 save_on_top = True |
bgneal@45 | 15 |
bgneal@45 | 16 class Media: |
bgneal@45 | 17 js = settings.THIRD_PARTY_JS['tiny_mce'] |
bgneal@45 | 18 |
bgneal@45 | 19 admin.site.register(News, NewsAdmin) |