comparison gpp/forums/admin.py @ 113:d97ceb95ce02

Forums: ForumLastVisit logic in place. Need to add code for topics and posts next.
author Brian Neal <bgneal@gmail.com>
date Sun, 11 Oct 2009 19:10:54 +0000
parents e67c4dd98db5
children 500e5875a306
comparison
equal deleted inserted replaced
112:d1b0b86441c0 113:d97ceb95ce02
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 from forums.models import FlaggedPost
11 from forums.models import TopicLastVisit
11 12
12 13
13 class CategoryAdmin(admin.ModelAdmin): 14 class CategoryAdmin(admin.ModelAdmin):
14 list_display = ('name', 'position', ) 15 list_display = ('name', 'position', )
15 prepopulated_fields = { 'slug': ('name', ) } 16 prepopulated_fields = { 'slug': ('name', ) }
46 47
47 class FlaggedPostAdmin(admin.ModelAdmin): 48 class FlaggedPostAdmin(admin.ModelAdmin):
48 list_display = ('__unicode__', 'flag_date', 'get_post_url') 49 list_display = ('__unicode__', 'flag_date', 'get_post_url')
49 50
50 51
52 class TopicLastVisitAdmin(admin.ModelAdmin):
53 raw_id_fields = ('user', 'topic')
54 list_display = ('user', 'topic', 'last_visit')
55
56
51 admin.site.register(Category, CategoryAdmin) 57 admin.site.register(Category, CategoryAdmin)
52 admin.site.register(Forum, ForumAdmin) 58 admin.site.register(Forum, ForumAdmin)
53 admin.site.register(Topic, TopicAdmin) 59 admin.site.register(Topic, TopicAdmin)
54 admin.site.register(Post, PostAdmin) 60 admin.site.register(Post, PostAdmin)
55 admin.site.register(FlaggedPost, FlaggedPostAdmin) 61 admin.site.register(FlaggedPost, FlaggedPostAdmin)
62 admin.site.register(TopicLastVisit, TopicLastVisitAdmin)