2008-07-19 07:54:34 +08:00
|
|
|
from django.contrib import admin
|
2008-08-26 06:14:22 +08:00
|
|
|
from django.conf import settings
|
|
|
|
from django.contrib.comments.models import Comment
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2008-07-19 07:54:34 +08:00
|
|
|
|
2008-08-26 06:14:22 +08:00
|
|
|
class CommentsAdmin(admin.ModelAdmin):
|
2008-07-19 07:54:34 +08:00
|
|
|
fieldsets = (
|
2008-08-26 06:14:22 +08:00
|
|
|
(None,
|
|
|
|
{'fields': ('content_type', 'object_pk', 'site')}
|
|
|
|
),
|
|
|
|
(_('Content'),
|
|
|
|
{'fields': ('user', 'user_name', 'user_email', 'user_url', 'comment')}
|
|
|
|
),
|
|
|
|
(_('Metadata'),
|
|
|
|
{'fields': ('submit_date', 'ip_address', 'is_public', 'is_removed')}
|
|
|
|
),
|
|
|
|
)
|
2008-07-19 07:54:34 +08:00
|
|
|
|
2008-08-26 06:14:22 +08:00
|
|
|
list_display = ('name', 'content_type', 'object_pk', 'ip_address', 'is_public', 'is_removed')
|
|
|
|
list_filter = ('submit_date', 'site', 'is_public', 'is_removed')
|
2008-07-19 07:54:34 +08:00
|
|
|
date_hierarchy = 'submit_date'
|
2008-08-26 06:14:22 +08:00
|
|
|
search_fields = ('comment', 'user__username', 'user_name', 'user_email', 'user_url', 'ip_address')
|
2008-07-19 07:54:34 +08:00
|
|
|
|
2008-08-26 06:14:22 +08:00
|
|
|
admin.site.register(Comment, CommentsAdmin)
|