|
@ -1,7 +1,7 @@ |
|
|
from django.shortcuts import render |
|
|
from django.shortcuts import render |
|
|
from django.urls import reverse |
|
|
from django.urls import reverse |
|
|
from django.views import generic |
|
|
from django.views import generic |
|
|
from django.db.models import Q |
|
|
from django.db.models import Q, Count |
|
|
from django.views.decorators.debug import sensitive_post_parameters |
|
|
from django.views.decorators.debug import sensitive_post_parameters |
|
|
from django.views.generic.base import TemplateView |
|
|
from django.views.generic.base import TemplateView |
|
|
from django.contrib.auth.models import User, Permission, Group |
|
|
from django.contrib.auth.models import User, Permission, Group |
|
@ -51,6 +51,10 @@ class OrgoRozcestnikView(TemplateView): |
|
|
context['muj_pocet_neobodovanych_reseni'] = neobodovana_reseni.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).distinct().count() |
|
|
context['muj_pocet_neobodovanych_reseni'] = neobodovana_reseni.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).distinct().count() |
|
|
context['muj_pocet_reseni_mimo_cislo'] = reseni_mimo_cislo.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).count() |
|
|
context['muj_pocet_reseni_mimo_cislo'] = reseni_mimo_cislo.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).count() |
|
|
|
|
|
|
|
|
|
|
|
# Termínářský přehled |
|
|
|
|
|
pocty_neopravenych_reseni = neobodovana_reseni.select_related('problem').values('problem__nazev').annotate(count=Count('problem')).order_by() |
|
|
|
|
|
context["pocty_neopravenych_reseni"] = [(it['problem__nazev'], it['count']) for it in pocty_neopravenych_reseni.all()] |
|
|
|
|
|
|
|
|
#FIXME: přidat stav='STAV_ZADANY' |
|
|
#FIXME: přidat stav='STAV_ZADANY' |
|
|
temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]), |
|
|
temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]), |
|
|
rocnik=aktualni_rocnik).distinct() |
|
|
rocnik=aktualni_rocnik).distinct() |
|
|