comparison gpp/forums/admin.py @ 98:d0d779dd0832

Forums: flag posts.
author Brian Neal <bgneal@gmail.com>
date Sun, 13 Sep 2009 21:45:35 +0000
parents 96eec1ed0fd3
children e67c4dd98db5
comparison
equal deleted inserted replaced
97:96eec1ed0fd3 98:d0d779dd0832
5 5
6 from forums.models import Category 6 from forums.models import Category
7 from forums.models import Forum 7 from forums.models import Forum
8 from forums.models import Topic 8 from forums.models import Topic
9 from forums.models import Post 9 from forums.models import Post
10 from forums.models import FlaggedPost
10 11
11 12
12 class CategoryAdmin(admin.ModelAdmin): 13 class CategoryAdmin(admin.ModelAdmin):
13 list_display = ('name', 'position', ) 14 list_display = ('name', 'position', )
14 prepopulated_fields = { 'slug': ('name', ) } 15 prepopulated_fields = { 'slug': ('name', ) }
41 list_filter = ('creation_date', 'update_date', ) 42 list_filter = ('creation_date', 'update_date', )
42 ordering = ('-creation_date', ) 43 ordering = ('-creation_date', )
43 save_on_top = True 44 save_on_top = True
44 45
45 46
47 class FlaggedPostAdmin(admin.ModelAdmin):
48 list_display = ('__unicode__', 'flag_date', 'get_post_url')
49
50
46 admin.site.register(Category, CategoryAdmin) 51 admin.site.register(Category, CategoryAdmin)
47 admin.site.register(Forum, ForumAdmin) 52 admin.site.register(Forum, ForumAdmin)
48 admin.site.register(Topic, TopicAdmin) 53 admin.site.register(Topic, TopicAdmin)
49 admin.site.register(Post, PostAdmin) 54 admin.site.register(Post, PostAdmin)
55 admin.site.register(FlaggedPost, FlaggedPostAdmin)