annotate gpp/news/admin.py @ 197:2baadae33f2e

Got autocomplete working for the member search. Updated django and ran into a bug where url tags with comma separated kwargs starting consuming tons of CPU throughput. The work-around is to cut over to using spaces between arguments. This is now allowed to be consistent with other tags. Did some query optimization for the news app.
author Brian Neal <bgneal@gmail.com>
date Sat, 10 Apr 2010 04:32:24 +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)