equal
deleted
inserted
replaced
|
1 from django.contrib import admin |
|
2 from django.conf import settings |
|
3 from django.contrib.comments.models import Comment |
|
4 from django.utils.translation import ugettext_lazy as _ |
|
5 |
|
6 class CommentsAdmin(admin.ModelAdmin): |
|
7 fieldsets = ( |
|
8 (None, |
|
9 {'fields': ('content_type', 'object_pk', 'site')} |
|
10 ), |
|
11 (_('Content'), |
|
12 {'fields': ('user', 'user_name', 'user_email', 'user_url', 'comment')} |
|
13 ), |
|
14 (_('Metadata'), |
|
15 {'fields': ('submit_date', 'ip_address', 'is_public', 'is_removed')} |
|
16 ), |
|
17 ) |
|
18 |
|
19 list_display = ('name', 'content_type', 'object_pk', 'ip_address', 'submit_date', 'is_public', 'is_removed') |
|
20 list_filter = ('submit_date', 'site', 'is_public', 'is_removed') |
|
21 date_hierarchy = 'submit_date' |
|
22 ordering = ('-submit_date',) |
|
23 search_fields = ('comment', 'user__username', 'user_name', 'user_email', 'user_url', 'ip_address') |
|
24 |
|
25 admin.site.register(Comment, CommentsAdmin) |