comparison gpp/comments/admin.py @ 1:dbd703f7d63a

Initial import of sg101 stuff from private repository.
author gremmie
date Mon, 06 Apr 2009 02:43:12 +0000
parents
children 777451a98f9d
comparison
equal deleted inserted replaced
0:900ba3c7b765 1:dbd703f7d63a
1 """
2 This file contains the automatic admin site definitions for the comment models.
3 """
4 from django.contrib import admin
5 from comments.models import Comment
6 from comments.models import CommentFlag
7
8 class CommentAdmin(admin.ModelAdmin):
9 fieldsets = (
10 (None,
11 {'fields': ('content_type', 'object_id', )}
12 ),
13 ('Content',
14 {'fields': ('user', 'comment')}
15 ),
16 ('Metadata',
17 {'fields': ('ip_address', 'is_public', 'is_removed')}
18 ),
19 )
20 list_display = ('__unicode__', 'content_type', 'object_id', 'ip_address', 'creation_date', 'is_public', 'is_removed')
21 list_filter = ('creation_date', 'is_public', 'is_removed')
22 date_hierarchy = 'creation_date'
23 ordering = ('-creation_date', )
24 search_fields = ('comment', 'user__username', 'ip_address')
25 raw_id_fields = ('user', 'content_type')
26
27 class CommentFlagAdmin(admin.ModelAdmin):
28 list_display = ('__unicode__', 'get_comment_url')
29
30 admin.site.register(Comment, CommentAdmin)
31 admin.site.register(CommentFlag, CommentFlagAdmin)