Remove flat comment document helper, update document indexing template accordingly
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user