From dd5d8886ee064553b26a12512ddda6493eef1d7f Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 22 May 2023 21:27:04 +0200 Subject: [PATCH] =?UTF-8?q?Trocha=20popisu=20TabulkaOdevzdanychReseniView,?= =?UTF-8?q?=20a=C5=A5=20se=20v=20tom=20d=C3=A1=20vyznat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odevzdavatko/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/odevzdavatko/views.py b/odevzdavatko/views.py index d3c74812..684b790b 100644 --- a/odevzdavatko/views.py +++ b/odevzdavatko/views.py @@ -125,7 +125,7 @@ class TabulkaOdevzdanychReseniView(ListView): ctx = super().get_context_data(*args, **kwargs) ctx['problemy'] = self.problemy ctx['resitele'] = self.resitele - tabulka = dict() + tabulka: dict[m.Problem, dict[m.Resitel, SouhrnReseni]] = dict() def pridej_reseni(problem, resitel, body, cas): if problem not in tabulka: @@ -145,11 +145,11 @@ class TabulkaOdevzdanychReseniView(ListView): for resitel in hodnoceni.reseni.resitele.all(): pridej_reseni(hodnoceni.problem, resitel, hodnoceni.body, hodnoceni.reseni.cas_doruceni) - hodnoty = [] - resitele_do_tabulky = [] + hodnoty: list[list[SouhrnReseni]] = [] + resitele_do_tabulky: list[m.Resitel] = [] for resitel in self.resitele: dostal_body = False - resiteluv_radek = [] + resiteluv_radek: list[SourhnReseni] = [] # podle pořadí v self.problemy, pokud daný problém neřešil, pak None for problem in self.problemy: if problem in tabulka and resitel in tabulka[problem]: resiteluv_radek.append(tabulka[problem][resitel])