1 from django.views.generic import ListView, DetailView
2 from django.conf import settings
3 from django.utils.translation import get_language
5 from .models import CommentDocument
8 class CommentDocumentList(ListView):
9 model = CommentDocument
11 def get_queryset(self, **kwargs):
12 return super(CommentDocumentList, self).get_queryset(**kwargs).filter(language_code = get_language())
15 class CommentDocument(DetailView):
16 model = CommentDocument
18 def get_context_data(self, **kwargs):
19 context = super(CommentDocument, self).get_context_data(**kwargs)
20 context['comment_url'] = settings.COMMENT_URL