1 # -*- coding: utf-8 -*-
2 from django.views.generic import ListView, DetailView
3 from django.conf import settings
4 from django.utils.translation import get_language
6 from django.core.urlresolvers import reverse
8 from .models import CommentDocument as CommentDocumentModel
11 class CommentDocumentList(ListView):
12 model = CommentDocument
14 def get_queryset(self):
15 return super(CommentDocumentList, self).get_queryset().filter(language_code=get_language())
17 def get_context_data(self, **kwargs):
18 context = super(CommentDocumentList, self).get_context_data(**kwargs)
19 context['form_href'] = reverse('contact_form', kwargs={'form_tag': 'mil'})
23 class CommentDocument(DetailView):
24 model = CommentDocumentModel
26 def get_context_data(self, **kwargs):
27 context = super(CommentDocument, self).get_context_data(**kwargs)
28 context['comment_url'] = settings.COMMENT_URL