comparison gpp/news/admin.py @ 1:dbd703f7d63a

Initial import of sg101 stuff from private repository.
author gremmie
date Mon, 06 Apr 2009 02:43:12 +0000
parents
children ca66189c7c44
comparison
equal deleted inserted replaced
0:900ba3c7b765 1:dbd703f7d63a
1 """
2 This file contains the automatic admin site definitions for the News models.
3 """
4
5 from django.contrib import admin
6 from news.models import PendingStory
7 from news.models import Story
8 from news.models import Category
9
10 class PendingStoryAdmin(admin.ModelAdmin):
11 list_display = ('title', 'date_submitted', 'submitter')
12 list_filter = ('date_submitted', )
13 search_fields = ('title', 'short_text', 'long_text')
14 date_hierarchy = 'date_submitted'
15
16 class Media:
17 js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_admin.js')
18
19
20 class StoryAdmin(admin.ModelAdmin):
21 list_display = ('title', 'date_published', 'submitter', 'category')
22 list_filter = ('date_published', 'category')
23 search_fields = ('title', 'short_text', 'long_text')
24 date_hierarchy = 'date_published'
25
26 class Media:
27 js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_admin.js')
28
29
30 admin.site.register(Category)
31 admin.site.register(Story, StoryAdmin)
32 admin.site.register(PendingStory, PendingStoryAdmin)