1
from django.contrib import admin
2
from django.utils.translation import ugettext_lazy as _
3
from threadedcomments.models import ThreadedComment, FreeThreadedComment
5
class ThreadedCommentAdmin(admin.ModelAdmin):
7
(None, {'fields': ('content_type', 'object_id')}),
8
(_('Parent'), {'fields' : ('parent',)}),
9
(_('Content'), {'fields': ('user', 'comment')}),
10
(_('Meta'), {'fields': ('is_public', 'date_submitted', 'date_modified', 'date_approved', 'is_approved', 'ip_address')}),
12
list_display = ('user', 'date_submitted', 'content_type', 'get_content_object', 'parent', '__unicode__')
13
list_filter = ('date_submitted',)
14
date_hierarchy = 'date_submitted'
15
search_fields = ('comment', 'user__username')
17
class FreeThreadedCommentAdmin(admin.ModelAdmin):
19
(None, {'fields': ('content_type', 'object_id')}),
20
(_('Parent'), {'fields' : ('parent',)}),
21
(_('Content'), {'fields': ('name', 'website', 'email', 'comment')}),
22
(_('Meta'), {'fields': ('date_submitted', 'date_modified', 'date_approved', 'is_public', 'ip_address', 'is_approved')}),
24
list_display = ('name', 'date_submitted', 'content_type', 'get_content_object', 'parent', '__unicode__')
25
list_filter = ('date_submitted',)
26
date_hierarchy = 'date_submitted'
27
search_fields = ('comment', 'name', 'email', 'website')
30
admin.site.register(ThreadedComment, ThreadedCommentAdmin)
31
admin.site.register(FreeThreadedComment, FreeThreadedCommentAdmin)