diff gpp/forums/admin.py @ 307:7e19180b128d

Fixing #97; adding a management command to remove old forum and topic last visit records.
author Brian Neal <bgneal@gmail.com>
date Sun, 16 Jan 2011 20:18:26 +0000
parents a46788862737
children 79d454ff2de0
line wrap: on
line diff
--- a/gpp/forums/admin.py	Sat Jan 15 21:55:37 2011 +0000
+++ b/gpp/forums/admin.py	Sun Jan 16 20:18:26 2011 +0000
@@ -8,6 +8,7 @@
 from forums.models import Topic
 from forums.models import Post
 from forums.models import FlaggedPost
+from forums.models import ForumLastVisit
 from forums.models import TopicLastVisit
 import bio.badges
 
@@ -64,6 +65,11 @@
     accept_flags.short_description = "Accept selected flagged posts"
 
 
+class ForumLastVisitAdmin(admin.ModelAdmin):
+    raw_id_fields = ('user', 'forum')
+    list_display = ('user', 'forum', 'begin_date', 'end_date')
+
+
 class TopicLastVisitAdmin(admin.ModelAdmin):
     raw_id_fields = ('user', 'topic')
     list_display = ('user', 'topic', 'last_visit')
@@ -74,4 +80,5 @@
 admin.site.register(Topic, TopicAdmin)
 admin.site.register(Post, PostAdmin)
 admin.site.register(FlaggedPost, FlaggedPostAdmin)
+admin.site.register(ForumLastVisit, ForumLastVisitAdmin)
 admin.site.register(TopicLastVisit, TopicLastVisitAdmin)