From c3f64ab1bfa00252935529ee05c9cefb79b23af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 1 Feb 2022 01:03:05 +0100 Subject: [PATCH] =?UTF-8?q?Term=C3=ADn=C3=A1=C5=99=C5=AFm=20se=20v=C3=ADc?= =?UTF-8?q?=20hod=C3=AD=20=C4=8Das=20ne=C5=BE=20po=C4=8Det?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/personalni/views.py b/personalni/views.py index 2ad1ea79..8e98a852 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -1,7 +1,7 @@ from django.shortcuts import render from django.urls import reverse from django.views import generic -from django.db.models import Q, Count +from django.db.models import Q, Count, Min from django.views.decorators.debug import sensitive_post_parameters from django.views.generic.base import TemplateView from django.contrib.auth.models import User, Permission, Group @@ -52,8 +52,8 @@ class OrgoRozcestnikView(TemplateView): 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()] + pocty_neopravenych_reseni = neobodovana_reseni.select_related('problem').values('problem__nazev').annotate(cas=Min('reseni__cas_doruceni')).order_by('cas') + context["pocty_neopravenych_reseni"] = [(it['problem__nazev'], it['cas'].date) for it in pocty_neopravenych_reseni.all()] #FIXME: přidat stav='STAV_ZADANY' temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]),