from django.contrib import admin
from django.template import defaultfilters
from moderator.models import ClassifiedComment


class ClassifiedCommentAdmin(admin.ModelAdmin):
    list_display = ('cls', 'comment_text', 'removed')
    list_display_links = ('removed', )
    list_editable = ('cls', )
    list_filter = ('cls', )

    def comment_text(self, obj):
        return defaultfilters.linebreaks(obj.comment.comment)
    comment_text.short_description = 'Comment'
    comment_text.allow_tags = True

    def removed(self, obj):
        return obj.comment.is_removed
    removed.boolean = True

admin.site.register(ClassifiedComment, ClassifiedCommentAdmin)

@@ -42,95 +42,754 @@
 ngo.
-template import defaultfilters%0Afrom moderator.models import ClassifiedComment%0A%0A%0Aclass C
+contrib.admin import SimpleListFilter%0Afrom django.contrib.comments.models import Comment%0Afrom django.contrib.comments.admin import CommentsAdmin as DjangoCommentsAdmin%0Afrom django.core.urlresolvers import reverse%0Afrom django.template import defaultfilters%0Afrom moderator import constants%0Afrom moderator.models import CannedReply, CommentReply%0A%0A%0Aclass ClassificationListFilter(SimpleListFilter):%0A    title = %22classification%22%0A    parameter_name = %22classification%22%0A%0A    def lookups(self, request, model_admin):%0A        return constants.CLASS_CHOICES%0A%0A    def queryset(self, request, queryset):%0A        %22%22%22%0A        Returns queryset filtered on categories and primary_category.%0A        %22%22%22%0A        if self.value():%0A            return queryset.filter(c
 lass
@@ -797,32 +797,227 @@
 fied
-C
+c
 omment
-Adm
+__cls=self.value())%0A%0A%0Aclass CommentReplyInl
 in
+e
 (admin.
-Model
+StackedInline):%0A    extra = 0%0A    exclude = %5B'reply_comment', %5D%0A    model = CommentReply%0A    fk_name = 'replied_to_comment'%0A%0A%0Aclass CommentAdmin(DjangoComments
 Admi
@@ -1046,38 +1046,114 @@
  ('c
-ls
+omment_text
 ', 'co
-mment_text', 'remov
+ntent', 'user', 'submit_date',%0A                    'classification', 'moderator_repli
 ed'
+,
 )%0A  
@@ -1163,95 +1163,608 @@
 ist_
-display_links = ('removed', )%0A    list_editable = ('cls', )%0A    list_filter = ('cls', )
+filter = ('submit_date', ClassificationListFilter)%0A    inlines = %5B%0A        CommentReplyInline,%0A    %5D%0A%0A    def content(self, obj):%0A        content = obj.content_object%0A        content_type = obj.content_type%0A        url = reverse('admin:%25s_%25s_change' %25 (content_type.app_label,%0A                                              content_type.model),%0A                      args=(content.id,))%0A%0A        return '%3Ca href=%22%25s%22%3E%25s%3C/a%3E' %25 (url, content)%0A    content.allow_tags = True%0A%0A    def moderator_replied(self, obj):%0A        return bool(obj.replied_to_comment_set.all())%0A    moderator_replied.boolean = True
 %0A%0A  
@@ -1846,24 +1846,16 @@
 .comment
-.comment
 )%0A    co
@@ -1939,23 +1939,30 @@
     def 
-removed
+classification
 (self, o
@@ -1990,52 +1990,195 @@
 bj.c
-omment.is_removed%0A
+lassifiedcomment_set.get().cls.title()%0A%0A    def queryset(self, request):%0A        qs = super(CommentAdmin, self).queryset(request)%0A   
     
+ 
 re
-moved.boolean = 
+turn qs.filter(reply_comment_set__isnull=
 True
+)%0A
 %0A%0Aad
@@ -2200,36 +2200,80 @@
 er(C
-lassifiedComment, Classified
+annedReply)%0Aadmin.site.unregister(Comment)%0Aadmin.site.register(Comment, 
 Comm

complete overhaul, no ties into comment admin itself