Added comment app with support for adding and deleting comments to and from documents

This commit is contained in:
Roberto Rosario
2011-05-01 04:40:42 -04:00
parent 3261bb08b1
commit 9cebfc978b
12 changed files with 297 additions and 2 deletions

20
apps/comments/utils.py Normal file
View File

@@ -0,0 +1,20 @@
from django.utils.translation import ugettext_lazy as _
from django.contrib.comments.models import Comment
from comments import comment_delete
def get_comments_subtemplate(obj):
"""
Return all the settings to render a subtemplate containing an
object's comments
"""
return {
'name': 'generic_list_subtemplate.html',
'context': {
'title': _(u'comments'),
'object_list': Comment.objects.for_model(obj),
'hide_link': True,
'hide_object': True,
'navigation_object_links': [comment_delete],
}
}