Mercurial > public > sg101
comparison gpp/news/admin.py @ 240:1246a4f1ab4f
For #93: fix url scheme for the news application.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 15 Sep 2010 00:14:54 +0000 |
parents | 6dbb8faef085 |
children | d424b8bae71d |
comparison
equal
deleted
inserted
replaced
239:dcc929973bba | 240:1246a4f1ab4f |
---|---|
7 from django.conf import settings | 7 from django.conf import settings |
8 | 8 |
9 from news.models import PendingStory | 9 from news.models import PendingStory |
10 from news.models import Story | 10 from news.models import Story |
11 from news.models import Category | 11 from news.models import Category |
12 | |
13 | |
14 class CategoryAdmin(admin.ModelAdmin): | |
15 prepopulated_fields = {'slug': ("title", )} | |
16 list_display = ('title', 'slug') | |
17 | |
12 | 18 |
13 class PendingStoryAdmin(admin.ModelAdmin): | 19 class PendingStoryAdmin(admin.ModelAdmin): |
14 list_display = ('title', 'date_submitted', 'submitter') | 20 list_display = ('title', 'date_submitted', 'submitter') |
15 list_filter = ('date_submitted', ) | 21 list_filter = ('date_submitted', ) |
16 search_fields = ('title', 'short_text', 'long_text') | 22 search_fields = ('title', 'short_text', 'long_text') |
46 | 52 |
47 class Media: | 53 class Media: |
48 js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] | 54 js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] |
49 | 55 |
50 | 56 |
51 admin.site.register(Category) | 57 admin.site.register(Category, CategoryAdmin) |
52 admin.site.register(Story, StoryAdmin) | 58 admin.site.register(Story, StoryAdmin) |
53 admin.site.register(PendingStory, PendingStoryAdmin) | 59 admin.site.register(PendingStory, PendingStoryAdmin) |