Pardon, tahle funkce brala něco jiného než tvrdila
This commit is contained in:
parent
623124e833
commit
e442a87421
1 changed files with 4 additions and 4 deletions
|
@ -354,14 +354,14 @@ class VysledkovkaCisla(Vysledkovka):
|
||||||
return len(self.hlavni_problemy) - len(self.temata_a_spol) > 0
|
return len(self.hlavni_problemy) - len(self.temata_a_spol) > 0
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def podproblemy(self) -> list[list[m.Problem]]:
|
def podproblemy(self) -> dict[int, list[m.Problem]]:
|
||||||
podproblemy = {hp.id: [] for hp in self.hlavni_problemy}
|
podproblemy = {hp.id: [] for hp in self.temata_a_spol}
|
||||||
hlavni_problemy = set(self.hlavni_problemy)
|
temata_a_spol = set(self.temata_a_spol)
|
||||||
podproblemy[-1] = []
|
podproblemy[-1] = []
|
||||||
|
|
||||||
for problem in self.problemy:
|
for problem in self.problemy:
|
||||||
h_problem = problem.hlavni_problem
|
h_problem = problem.hlavni_problem
|
||||||
if h_problem in hlavni_problemy:
|
if h_problem in temata_a_spol:
|
||||||
podproblemy[h_problem.id].append(problem)
|
podproblemy[h_problem.id].append(problem)
|
||||||
else:
|
else:
|
||||||
podproblemy[-1].append(problem)
|
podproblemy[-1].append(problem)
|
||||||
|
|
Loading…
Reference in a new issue