|
|
@ -22,17 +22,26 @@ class KorekturyListView(generic.ListView): |
|
|
|
template_name = 'korektury/seznam.html' |
|
|
|
|
|
|
|
class KorekturyAktualniListView(KorekturyListView): |
|
|
|
def __init__ (self): |
|
|
|
self.queryset=self.get_queryset().exclude(status="zastarale") |
|
|
|
def get_queryset(self, *args, **kwargs): |
|
|
|
queryset=super(KorekturyAktualniListView,self).get_queryset() |
|
|
|
queryset=queryset.exclude(status="zastarale") |
|
|
|
return queryset |
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(KorekturyAktualniListView,self).get_context_data(**kwargs) |
|
|
|
context['aktualni'] = True |
|
|
|
context['selected'] = 'aktualni' |
|
|
|
return context |
|
|
|
|
|
|
|
class KorekturyZastaraleListView(KorekturyListView): |
|
|
|
def __init__ (self): |
|
|
|
self.queryset=self.get_queryset().filter(status="zastarale") |
|
|
|
def get_queryset(self, *args, **kwargs): |
|
|
|
queryset=super(KorekturyZastaraleListView,self).get_queryset() |
|
|
|
queryset=queryset.filter(status="zastarale") |
|
|
|
return queryset |
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(KorekturyZastaraleListView,self).get_context_data(**kwargs) |
|
|
|
context['selected'] = 'zastarale' |
|
|
|
return context |
|
|
|
|
|
|
|
### Korektury |
|
|
|
class KorekturyView(generic.TemplateView): |
|
|
|