comparison gpp/news/admin.py @ 7:ca66189c7c44

Added tiny_mce to the GPP_THIRD_PARTY_JS setting. Updated code to use it.
author Brian Neal <bgneal@gmail.com>
date Sun, 12 Apr 2009 00:31:36 +0000
parents dbd703f7d63a
children b4305e18d3af
comparison
equal deleted inserted replaced
6:b6263ac72052 7:ca66189c7c44
1 """ 1 """
2 This file contains the automatic admin site definitions for the News models. 2 This file contains the automatic admin site definitions for the News models.
3 """ 3 """
4 4
5 from django.contrib import admin 5 from django.contrib import admin
6 from django.conf import settings
7
6 from news.models import PendingStory 8 from news.models import PendingStory
7 from news.models import Story 9 from news.models import Story
8 from news.models import Category 10 from news.models import Category
9 11
10 class PendingStoryAdmin(admin.ModelAdmin): 12 class PendingStoryAdmin(admin.ModelAdmin):
12 list_filter = ('date_submitted', ) 14 list_filter = ('date_submitted', )
13 search_fields = ('title', 'short_text', 'long_text') 15 search_fields = ('title', 'short_text', 'long_text')
14 date_hierarchy = 'date_submitted' 16 date_hierarchy = 'date_submitted'
15 17
16 class Media: 18 class Media:
17 js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_admin.js') 19 js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
18 20
19 21
20 class StoryAdmin(admin.ModelAdmin): 22 class StoryAdmin(admin.ModelAdmin):
21 list_display = ('title', 'date_published', 'submitter', 'category') 23 list_display = ('title', 'date_published', 'submitter', 'category')
22 list_filter = ('date_published', 'category') 24 list_filter = ('date_published', 'category')
23 search_fields = ('title', 'short_text', 'long_text') 25 search_fields = ('title', 'short_text', 'long_text')
24 date_hierarchy = 'date_published' 26 date_hierarchy = 'date_published'
25 27
26 class Media: 28 class Media:
27 js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_admin.js') 29 js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
28 30
29 31
30 admin.site.register(Category) 32 admin.site.register(Category)
31 admin.site.register(Story, StoryAdmin) 33 admin.site.register(Story, StoryAdmin)
32 admin.site.register(PendingStory, PendingStoryAdmin) 34 admin.site.register(PendingStory, PendingStoryAdmin)