From ccc26f9566ba457f0bd3b32d39c96dbeab114d39 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 21 May 2012 10:42:17 -0400 Subject: [PATCH] Remove flat comment document helper, update document indexing template accordingly --- apps/document_comments/__init__.py | 7 ------- .../templates/search/indexes/documents/document_text.txt | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/document_comments/__init__.py b/apps/document_comments/__init__.py index 53bc133a94..2356f36885 100644 --- a/apps/document_comments/__init__.py +++ b/apps/document_comments/__init__.py @@ -40,11 +40,6 @@ register_links(['comments_for_document', 'comment_add', 'comment_delete', 'comme register_links(Comment, [comment_delete]) register_links(Document, [comments_for_document], menu_name='form_header') - -def flat_comments(document): - return u' '.join(document.comments.values_list('comment', flat=True)) - - Document.add_to_class( 'comments', generic.GenericRelation( @@ -54,8 +49,6 @@ Document.add_to_class( ) ) -Document.add_to_class('flat_comments', flat_comments) - class_permissions(Document, [ PERMISSION_COMMENT_CREATE, PERMISSION_COMMENT_DELETE, diff --git a/apps/dynamic_search/templates/search/indexes/documents/document_text.txt b/apps/dynamic_search/templates/search/indexes/documents/document_text.txt index 12ce19fa6f..77dfc80213 100644 --- a/apps/dynamic_search/templates/search/indexes/documents/document_text.txt +++ b/apps/dynamic_search/templates/search/indexes/documents/document_text.txt @@ -10,7 +10,10 @@ {{ object.document_type }} {{ object.file_mimetype }} {{ object.description|default:' ' }} -{{ object.flat_comments }} + +{% for comment in object.comments.all %} + {{ comment.comment }} +{% endfor %} {% for tag in object.tags.all %} {{ tag }}