1 from django.views.generic import ListView, DetailView
2 from django.conf import settings
3 from django.utils.translation import get_language
5 from django.core.urlresolvers import reverse
7 from .models import CommentDocument
10 class CommentDocumentList(ListView):
11 model = CommentDocument
13 def get_queryset(self, **kwargs):
14 return super(CommentDocumentList, self).get_queryset(**kwargs).filter(language_code = get_language())
16 def get_context_data(self, **kwargs):
17 context = super(CommentDocumentList, self).get_context_data(**kwargs)
18 context['form_href'] = reverse('contact_form', kwargs = dict(form_tag = 'mil'))
22 class CommentDocument(DetailView):
23 model = CommentDocument
25 def get_context_data(self, **kwargs):
26 context = super(CommentDocument, self).get_context_data(**kwargs)
27 context['comment_url'] = settings.COMMENT_URL