37 lines
966 B
Python
37 lines
966 B
Python
from .utils import data_vysledkovky_cisla, \
|
|
data_vysledkovky_rocniku
|
|
|
|
|
|
def vysledkovka_cisla(cislo, context=None):
|
|
if context is None:
|
|
context = {}
|
|
context['cislo'] = cislo
|
|
|
|
(
|
|
context['radky_vysledkovky'],
|
|
context['problemy'],
|
|
context['ostatni'],
|
|
context['podproblemy'],
|
|
context['podproblemy_iter']
|
|
) = data_vysledkovky_cisla(cislo)
|
|
return context
|
|
|
|
|
|
def vysledkovka_rocniku(rocnik, context=None, request=None, sneverejnou=False):
|
|
if context is None:
|
|
context = {}
|
|
|
|
(
|
|
context['radky_vysledkovky'],
|
|
context['cisla']
|
|
) = data_vysledkovky_rocniku(rocnik)
|
|
|
|
context['vysledkovka'] = len(context['cisla']) != 0
|
|
|
|
if sneverejnou and request and request.user.je_org:
|
|
(
|
|
context['radky_vysledkovky_s_neverejnymi'],
|
|
context['cisla_s_neverejnymi']
|
|
) = data_vysledkovky_rocniku(rocnik, jen_verejne=False)
|
|
|
|
return context
|