X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/736d94f6ac63f205be2967f013a15c457032fc2f..4745d72c4d1baa545b4026463e0dd645d04f5a27:/comment/views.py?ds=sidebyside diff --git a/comment/views.py b/comment/views.py index 1471029..c7bd9fb 100644 --- a/comment/views.py +++ b/comment/views.py @@ -1,26 +1,27 @@ +# -*- coding: utf-8 -*- from django.views.generic import ListView, DetailView from django.conf import settings from django.utils.translation import get_language from django.core.urlresolvers import reverse -from .models import CommentDocument +from .models import CommentDocument as CommentDocumentModel class CommentDocumentList(ListView): model = CommentDocument - def get_queryset(self, **kwargs): - return super(CommentDocumentList, self).get_queryset(**kwargs).filter(language_code = get_language()) + def get_queryset(self): + return super(CommentDocumentList, self).get_queryset().filter(language_code=get_language()) def get_context_data(self, **kwargs): context = super(CommentDocumentList, self).get_context_data(**kwargs) - context['form_href'] = reverse('contact_form', kwargs = dict(form_tag = 'mil')) + context['form_href'] = reverse('contact_form', kwargs={'form_tag': 'mil'}) return context class CommentDocument(DetailView): - model = CommentDocument + model = CommentDocumentModel def get_context_data(self, **kwargs): context = super(CommentDocument, self).get_context_data(**kwargs)