Compare commits
No commits in common. "502588fd3ab877ebe71d163e3aa2857c5867839e" and "b4b6c7c0ce7ed08cd3a42a3eb430168588ab1e0a" have entirely different histories.
502588fd3a
...
b4b6c7c0ce
2 changed files with 3 additions and 8 deletions
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<br>
|
||||
|
||||
{% for rocnik, hodnoceni, suma_bodu in podle_rocniku %}
|
||||
{% for rocnik, hodnoceni in podle_rocniku %}
|
||||
<h1>Ročník {{ rocnik }}</h1>
|
||||
<table class="moje_reseni plne_ohranicena_tabulka">
|
||||
<tr>
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p>Celkový počet bodů {{suma_bodu}}</p>
|
||||
|
||||
<br>
|
||||
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -356,12 +356,7 @@ class PrehledOdevzdanychReseni(ListView):
|
|||
# Chceme to mít seřazené, takže místo comphrerehsion ručně postavíme pole polí. Django templates neumí použít OrderedDict :-/
|
||||
podle_rocniku = []
|
||||
for rocnik, hodnoceni in groupby(ctx['object_list'], lambda ho: ho.deadline_body.cislo.rocnik if ho.deadline_body is not None else None):
|
||||
suma_bodu = 0
|
||||
hodnoceni = list(hodnoceni)
|
||||
for i in hodnoceni :
|
||||
if i.body != None : suma_bodu += i.body
|
||||
podle_rocniku.append((rocnik, hodnoceni, suma_bodu))
|
||||
|
||||
podle_rocniku.append((rocnik, list(hodnoceni)))
|
||||
ctx['podle_rocniku'] = reversed(podle_rocniku) # Od nejnovějšího ročníku
|
||||
# TODO: Umožnit stažení / zobrazení řešení
|
||||
return ctx
|
||||
|
|
|
|||
Loading…
Reference in a new issue