Remove flat comment document helper, update document indexing template accordingly

This commit is contained in:
Roberto Rosario
2012-05-21 10:42:17 -04:00
parent 98c387fbd0
commit ccc26f9566
2 changed files with 4 additions and 8 deletions

View File

@@ -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,

View File

@@ -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 }}