comparison news/admin.py @ 1036:b7b98c729abc

Update news story admin to allow editing comment thread.
author Brian Neal <bgneal@gmail.com>
date Sun, 27 Dec 2015 12:00:51 -0600
parents cd4db27c90e3
children
comparison
equal deleted inserted replaced
1035:eeaf387803c6 1036:b7b98c729abc
101 list_display = ['title', 'date_submitted', 'submitter', 'category'] 101 list_display = ['title', 'date_submitted', 'submitter', 'category']
102 list_filter = ['date_submitted', 'category'] 102 list_filter = ['date_submitted', 'category']
103 search_fields = ['title', 'short_text', 'long_text'] 103 search_fields = ['title', 'short_text', 'long_text']
104 date_hierarchy = 'date_submitted' 104 date_hierarchy = 'date_submitted'
105 readonly_fields = ['update_date', 'version'] 105 readonly_fields = ['update_date', 'version']
106 raw_id_fields = ['submitter'] 106 raw_id_fields = ['submitter', 'forums_topic']
107 actions = ['fix_text'] 107 actions = ['fix_text']
108 108
109 fieldsets = PendingStoryAdmin.fieldsets 109 fieldsets = PendingStoryAdmin.fieldsets + [
110 ('Comments', {
111 'fields': ['forums_topic'],
112 })
113 ]
110 114
111 def fix_text(self, request, qs): 115 def fix_text(self, request, qs):
112 for story in qs: 116 for story in qs:
113 story.title = ftfy.fix_text(story.title) 117 story.title = ftfy.fix_text(story.title)
114 story.short_text = ftfy.fix_text(story.short_text) 118 story.short_text = ftfy.fix_text(story.short_text)