gremmie@1: """ gremmie@1: This file contains the automatic admin site definitions for the News models. gremmie@1: """ gremmie@1: gremmie@1: from django.contrib import admin bgneal@7: from django.conf import settings bgneal@7: gremmie@1: from news.models import PendingStory gremmie@1: from news.models import Story gremmie@1: from news.models import Category gremmie@1: gremmie@1: class PendingStoryAdmin(admin.ModelAdmin): gremmie@1: list_display = ('title', 'date_submitted', 'submitter') gremmie@1: list_filter = ('date_submitted', ) gremmie@1: search_fields = ('title', 'short_text', 'long_text') gremmie@1: date_hierarchy = 'date_submitted' gremmie@1: gremmie@1: class Media: bgneal@7: js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] gremmie@1: gremmie@1: gremmie@1: class StoryAdmin(admin.ModelAdmin): gremmie@1: list_display = ('title', 'date_published', 'submitter', 'category') gremmie@1: list_filter = ('date_published', 'category') gremmie@1: search_fields = ('title', 'short_text', 'long_text') gremmie@1: date_hierarchy = 'date_published' gremmie@1: gremmie@1: class Media: bgneal@7: js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] gremmie@1: gremmie@1: gremmie@1: admin.site.register(Category) gremmie@1: admin.site.register(Story, StoryAdmin) gremmie@1: admin.site.register(PendingStory, PendingStoryAdmin)