|
|
@ -29,11 +29,11 @@ def AktualniZadaniView(request): |
|
|
|
}, |
|
|
|
) |
|
|
|
|
|
|
|
def TemataView(request): |
|
|
|
def ZadaniTemataView(request): |
|
|
|
nastaveni = get_object_or_404(Nastaveni) |
|
|
|
return render(request, 'seminar/zadani/Temata.html', |
|
|
|
{ |
|
|
|
'temata': Problem.objects.filter(typ=Problem.TYP_TEMA, cislo_zadani__rocnik=nastaveni.aktualni_rocnik), |
|
|
|
'temata': Problem.objects.filter(typ=Problem.TYP_TEMA, stav=Problem.STAV_ZADANY, cislo_zadani__rocnik=nastaveni.aktualni_rocnik), |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
@ -236,8 +236,7 @@ class CisloView(generic.DetailView): |
|
|
|
class ArchivTemataView(generic.ListView): |
|
|
|
model = Problem |
|
|
|
template_name = 'seminar/archiv/temata.html' |
|
|
|
query = Problem.objects.filter(typ=Problem.TYP_TEMA).select_related('cislo_zadani__rocnik__rocnik').order_by('-cislo_zadani__rocnik__rocnik', 'kod') |
|
|
|
queryset = [{"rocnik": r, "temata": list(x)} for r, x in groupby(query, lambda x: x.cislo_zadani.rocnik.rocnik)] |
|
|
|
queryset = Problem.objects.filter(typ=Problem.TYP_TEMA, stav=Problem.STAV_ZADANY).select_related('cislo_zadani__rocnik__rocnik').order_by('-cislo_zadani__rocnik__rocnik', 'kod') |
|
|
|
|
|
|
|
### Generovani vysledkovky |
|
|
|
|
|
|
|