diff gpp/news/admin.py @ 240:1246a4f1ab4f

For #93: fix url scheme for the news application.
author Brian Neal <bgneal@gmail.com>
date Wed, 15 Sep 2010 00:14:54 +0000
parents 6dbb8faef085
children d424b8bae71d
line wrap: on
line diff
--- a/gpp/news/admin.py	Sun Sep 12 18:30:23 2010 +0000
+++ b/gpp/news/admin.py	Wed Sep 15 00:14:54 2010 +0000
@@ -10,6 +10,12 @@
 from news.models import Story
 from news.models import Category
 
+
+class CategoryAdmin(admin.ModelAdmin):
+    prepopulated_fields = {'slug': ("title", )}
+    list_display = ('title', 'slug')
+
+
 class PendingStoryAdmin(admin.ModelAdmin):
     list_display = ('title', 'date_submitted', 'submitter')
     list_filter = ('date_submitted', )
@@ -48,6 +54,6 @@
         js = settings.GPP_THIRD_PARTY_JS['tiny_mce']
 
 
-admin.site.register(Category)
+admin.site.register(Category, CategoryAdmin)
 admin.site.register(Story, StoryAdmin)
 admin.site.register(PendingStory, PendingStoryAdmin)