app/django/contrib/comments/admin.py
author Todd Larsen <tlarsen@google.com>
Wed, 14 Jan 2009 20:37:56 +0000
changeset 810 208659644a7f
parent 323 ff1a9aa48cfd
permissions -rw-r--r--
Hide 'tos' pull-down selector from Program profile forms. Until a way to select Documents for use as the Terms of Service for a Program exists (see http://code.google.com/p/soc/issues/detail?id=151), there is no point in hacking in scope_path and link_id fields here. The per-Program ToS feature will just be unavailable until an appropriate Document selector exists. Patch by: Todd Larsen Review by: to-be-reviewed

from django.contrib import admin
from django.conf import settings
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _

class CommentsAdmin(admin.ModelAdmin):
    fieldsets = (
        (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')}
        ),
     )

    list_display = ('name', 'content_type', 'object_pk', 'ip_address', 'submit_date', 'is_public', 'is_removed')
    list_filter = ('submit_date', 'site', 'is_public', 'is_removed')
    date_hierarchy = 'submit_date'
    ordering = ('-submit_date',)
    search_fields = ('comment', 'user__username', 'user_name', 'user_email', 'user_url', 'ip_address')

admin.site.register(Comment, CommentsAdmin)