Razeni lidi podle poctu korektur.

This commit is contained in:
Tomas "Jethro" Pokorny 2016-11-12 14:00:49 +01:00
parent 7a4ea302a4
commit 8671822ca0
2 changed files with 4 additions and 2 deletions

View file

@ -83,8 +83,8 @@
<hr/> <hr/>
<p> <p>
Děkujeme opravovatelům: Děkujeme opravovatelům:
{% for autor,pocet in zasluhy.items %} {% for z in zasluhy %}
{{autor}} ({{pocet}}){% if not forloop.last %},{% endif %} {{z.autor}} ({{z.pocet}}){% if not forloop.last %},{% endif %}
{% endfor %}</p> {% endfor %}</p>
<hr> <hr>

View file

@ -184,6 +184,8 @@ class KorekturyView(generic.TemplateView):
zasluhy[k.autor]+=1 zasluhy[k.autor]+=1
else: else:
zasluhy[k.autor]=1 zasluhy[k.autor]=1
zasluhy = [{'autor':jmeno, 'pocet':pocet} for (jmeno,pocet) in zasluhy.items()]
zasluhy.sort(key=lambda z:z['pocet'],reverse=True)
strany = set(o.strana for o in opravy) strany = set(o.strana for o in opravy)
opravy_na_stranu = [{'strana': s, 'op_id': opravy.filter(strana=s)} for s in strany] opravy_na_stranu = [{'strana': s, 'op_id': opravy.filter(strana=s)} for s in strany]