|
|
@ -5,6 +5,7 @@ from django.utils.translation import ugettext as _ |
|
|
|
from django.conf import settings |
|
|
|
from django.http import HttpResponseForbidden |
|
|
|
from django.core.mail import send_mail |
|
|
|
from django.db.models import Count,Q |
|
|
|
|
|
|
|
from .models import Oprava,Komentar,KorekturovanePDF, Organizator |
|
|
|
from .forms import OpravaForm |
|
|
@ -17,8 +18,16 @@ import unicodedata |
|
|
|
class KorekturyHelpView(generic.TemplateView): |
|
|
|
template_name = 'korektury/help.html' |
|
|
|
|
|
|
|
|
|
|
|
class KorekturyListView(generic.ListView): |
|
|
|
model = KorekturovanePDF |
|
|
|
# Nefunguje, filtry se vubec nepouziji |
|
|
|
queryset = KorekturovanePDF.objects.annotate( |
|
|
|
k_oprave_cnt=Count('oprava',filter=Q(oprava__status='k_oprave')), |
|
|
|
opraveno_cnt=Count('oprava',filter=Q(oprava__status='opraveno')), |
|
|
|
neni_chyba_cnt=Count('oprava',filter=Q(oprava__status='neni_chyba')), |
|
|
|
k_zaneseni_cnt=Count('oprava',filter=Q(oprava__status='k_zaneseni')), |
|
|
|
) |
|
|
|
template_name = 'korektury/seznam.html' |
|
|
|
|
|
|
|
### Korektury |
|
|
@ -191,6 +200,11 @@ class KorekturyView(generic.TemplateView): |
|
|
|
opravy_na_stranu = [{'strana': s, 'op_id': opravy.filter(strana=s)} for s in strany] |
|
|
|
context['opravy_strany'] = opravy_na_stranu |
|
|
|
|
|
|
|
context['k_oprave_cnt'] = opravy.filter(status='k_oprave').count() |
|
|
|
context['opraveno_cnt'] = opravy.filter(status='opraveno').count() |
|
|
|
context['neni_chyba_cnt'] = opravy.filter(status='neni_chyba').count() |
|
|
|
context['k_zaneseni_cnt'] = opravy.filter(status='k_zaneseni').count() |
|
|
|
|
|
|
|
context['opravy'] = opravy |
|
|
|
context['zasluhy'] = zasluhy |
|
|
|
return context |
|
|
|