Patch, když jsou bez řešení
This commit is contained in:
parent
beba4c5062
commit
797256fcfe
1 changed files with 12 additions and 8 deletions
|
@ -50,14 +50,18 @@ class TabulkaOdevzdanychReseniView(TemplateView):
|
||||||
hodnoceni__problem__in=[problem], # ditto
|
hodnoceni__problem__in=[problem], # ditto
|
||||||
).order_by('-cas_doruceni')
|
).order_by('-cas_doruceni')
|
||||||
pocet_reseni = reseni_k_tomuto_problemu.count()
|
pocet_reseni = reseni_k_tomuto_problemu.count()
|
||||||
nejnovejsi = reseni_k_tomuto_problemu.first().cas_doruceni
|
if pocet_reseni > 0:
|
||||||
pocet_bodu = max(
|
nejnovejsi = reseni_k_tomuto_problemu.first().cas_doruceni
|
||||||
[h.body for h in m.Hodnoceni.objects.filter(
|
pocet_bodu = max(
|
||||||
reseni__in=reseni_k_tomuto_problemu,
|
[h.body for h in m.Hodnoceni.objects.filter(
|
||||||
problem=problem,
|
reseni__in=reseni_k_tomuto_problemu,
|
||||||
)
|
problem=problem,
|
||||||
]
|
)
|
||||||
)
|
]
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
nejnovejsi = None
|
||||||
|
pocet_bodu = None
|
||||||
ctx['radky'][resitel].append(
|
ctx['radky'][resitel].append(
|
||||||
SouhrnReseni(
|
SouhrnReseni(
|
||||||
pocet_reseni=pocet_reseni,
|
pocet_reseni=pocet_reseni,
|
||||||
|
|
Loading…
Reference in a new issue