annotate gpp/news/admin.py @ 173:a88041a84957

Updated Django to 1.2 beta. Use new DATABASES setting.
author Brian Neal <bgneal@gmail.com>
date Tue, 02 Mar 2010 04:11:27 +0000
parents ca66189c7c44
children b4305e18d3af
rev   line source
gremmie@1 1 """
gremmie@1 2 This file contains the automatic admin site definitions for the News models.
gremmie@1 3 """
gremmie@1 4
gremmie@1 5 from django.contrib import admin
bgneal@7 6 from django.conf import settings
bgneal@7 7
gremmie@1 8 from news.models import PendingStory
gremmie@1 9 from news.models import Story
gremmie@1 10 from news.models import Category
gremmie@1 11
gremmie@1 12 class PendingStoryAdmin(admin.ModelAdmin):
gremmie@1 13 list_display = ('title', 'date_submitted', 'submitter')
gremmie@1 14 list_filter = ('date_submitted', )
gremmie@1 15 search_fields = ('title', 'short_text', 'long_text')
gremmie@1 16 date_hierarchy = 'date_submitted'
gremmie@1 17
gremmie@1 18 class Media:
bgneal@7 19 js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
gremmie@1 20
gremmie@1 21
gremmie@1 22 class StoryAdmin(admin.ModelAdmin):
gremmie@1 23 list_display = ('title', 'date_published', 'submitter', 'category')
gremmie@1 24 list_filter = ('date_published', 'category')
gremmie@1 25 search_fields = ('title', 'short_text', 'long_text')
gremmie@1 26 date_hierarchy = 'date_published'
gremmie@1 27
gremmie@1 28 class Media:
bgneal@7 29 js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
gremmie@1 30
gremmie@1 31
gremmie@1 32 admin.site.register(Category)
gremmie@1 33 admin.site.register(Story, StoryAdmin)
gremmie@1 34 admin.site.register(PendingStory, PendingStoryAdmin)