Přidání termínářského přehledu do orgorozcestniku
This commit is contained in:
parent
bc07d195bf
commit
e6145b090a
2 changed files with 18 additions and 1 deletions
|
@ -94,6 +94,19 @@
|
||||||
<li><a href="/admin/seminar/organizator/{{ organizator.id }}/change/"><strong>upravit </strong></a></li>
|
<li><a href="/admin/seminar/organizator/{{ organizator.id }}/change/"><strong>upravit </strong></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<h2><strong>Termínářský souhrn</strong></h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li> Počty neobodovaných řešení:
|
||||||
|
<ul>
|
||||||
|
{% for problem, pocet in pocty_neopravenych_reseni %}
|
||||||
|
<li>{{ problem }}: {{ pocet }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
<p>Nemůžeš najít, co hledáš? Může to být v <a href="/admin/">administračním rozhraní webu</a>.</p>
|
<p>Nemůžeš najít, co hledáš? Může to být v <a href="/admin/">administračním rozhraní webu</a>.</p>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.views import generic
|
from django.views import generic
|
||||||
from django.db.models import Q
|
from django.db.models import Q, Count
|
||||||
from django.views.decorators.debug import sensitive_post_parameters
|
from django.views.decorators.debug import sensitive_post_parameters
|
||||||
from django.views.generic.base import TemplateView
|
from django.views.generic.base import TemplateView
|
||||||
from django.contrib.auth.models import User, Permission, Group
|
from django.contrib.auth.models import User, Permission, Group
|
||||||
|
@ -51,6 +51,10 @@ class OrgoRozcestnikView(TemplateView):
|
||||||
context['muj_pocet_neobodovanych_reseni'] = neobodovana_reseni.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).distinct().count()
|
context['muj_pocet_neobodovanych_reseni'] = neobodovana_reseni.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).distinct().count()
|
||||||
context['muj_pocet_reseni_mimo_cislo'] = reseni_mimo_cislo.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).count()
|
context['muj_pocet_reseni_mimo_cislo'] = reseni_mimo_cislo.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).count()
|
||||||
|
|
||||||
|
# Termínářský přehled
|
||||||
|
pocty_neopravenych_reseni = neobodovana_reseni.select_related('problem').values('problem__nazev').annotate(count=Count('problem')).order_by()
|
||||||
|
context["pocty_neopravenych_reseni"] = [(it['problem__nazev'], it['count']) for it in pocty_neopravenych_reseni.all()]
|
||||||
|
|
||||||
#FIXME: přidat stav='STAV_ZADANY'
|
#FIXME: přidat stav='STAV_ZADANY'
|
||||||
temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]),
|
temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]),
|
||||||
rocnik=aktualni_rocnik).distinct()
|
rocnik=aktualni_rocnik).distinct()
|
||||||
|
|
Loading…
Reference in a new issue