comparison gpp/news/admin.py @ 372:7c7201f942fe

Added raw_id_fields for submitter on news stories and pending stories.
author Brian Neal <bgneal@gmail.com>
date Sun, 06 Mar 2011 20:51:15 +0000
parents d424b8bae71d
children 701730b2fcda
comparison
equal deleted inserted replaced
371:c8c0fa817a05 372:7c7201f942fe
21 list_filter = ('date_submitted', ) 21 list_filter = ('date_submitted', )
22 search_fields = ('title', 'short_text', 'long_text') 22 search_fields = ('title', 'short_text', 'long_text')
23 date_hierarchy = 'date_submitted' 23 date_hierarchy = 'date_submitted'
24 actions = ('approve_story', ) 24 actions = ('approve_story', )
25 readonly_fields = ('update_date', ) 25 readonly_fields = ('update_date', )
26 raw_id_fields = ('submitter', )
26 27
27 def approve_story(self, request, qs): 28 def approve_story(self, request, qs):
28 for pending_story in qs: 29 for pending_story in qs:
29 story = Story( 30 story = Story(
30 title=pending_story.title, 31 title=pending_story.title,
49 list_display = ('title', 'date_submitted', 'submitter', 'category') 50 list_display = ('title', 'date_submitted', 'submitter', 'category')
50 list_filter = ('date_submitted', 'category') 51 list_filter = ('date_submitted', 'category')
51 search_fields = ('title', 'short_text', 'long_text') 52 search_fields = ('title', 'short_text', 'long_text')
52 date_hierarchy = 'date_submitted' 53 date_hierarchy = 'date_submitted'
53 readonly_fields = ('update_date', ) 54 readonly_fields = ('update_date', )
55 raw_id_fields = ('submitter', )
54 56
55 class Media: 57 class Media:
56 js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] 58 js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
57 59
58 60