Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
306:6ca2c474d92f | 307:7e19180b128d |
---|---|
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 ForumLastVisit | |
11 from forums.models import TopicLastVisit | 12 from forums.models import TopicLastVisit |
12 import bio.badges | 13 import bio.badges |
13 | 14 |
14 | 15 |
15 class CategoryAdmin(admin.ModelAdmin): | 16 class CategoryAdmin(admin.ModelAdmin): |
62 flag.delete() | 63 flag.delete() |
63 | 64 |
64 accept_flags.short_description = "Accept selected flagged posts" | 65 accept_flags.short_description = "Accept selected flagged posts" |
65 | 66 |
66 | 67 |
68 class ForumLastVisitAdmin(admin.ModelAdmin): | |
69 raw_id_fields = ('user', 'forum') | |
70 list_display = ('user', 'forum', 'begin_date', 'end_date') | |
71 | |
72 | |
67 class TopicLastVisitAdmin(admin.ModelAdmin): | 73 class TopicLastVisitAdmin(admin.ModelAdmin): |
68 raw_id_fields = ('user', 'topic') | 74 raw_id_fields = ('user', 'topic') |
69 list_display = ('user', 'topic', 'last_visit') | 75 list_display = ('user', 'topic', 'last_visit') |
70 | 76 |
71 | 77 |
72 admin.site.register(Category, CategoryAdmin) | 78 admin.site.register(Category, CategoryAdmin) |
73 admin.site.register(Forum, ForumAdmin) | 79 admin.site.register(Forum, ForumAdmin) |
74 admin.site.register(Topic, TopicAdmin) | 80 admin.site.register(Topic, TopicAdmin) |
75 admin.site.register(Post, PostAdmin) | 81 admin.site.register(Post, PostAdmin) |
76 admin.site.register(FlaggedPost, FlaggedPostAdmin) | 82 admin.site.register(FlaggedPost, FlaggedPostAdmin) |
83 admin.site.register(ForumLastVisit, ForumLastVisitAdmin) | |
77 admin.site.register(TopicLastVisit, TopicLastVisitAdmin) | 84 admin.site.register(TopicLastVisit, TopicLastVisitAdmin) |