Merge branch 'master' into stable
Oprava padání čísel, která mají ve výsledkovce něco jiného než úlohy a témata.
This commit is contained in:
commit
a90ed0c76b
2 changed files with 11 additions and 2 deletions
|
@ -459,7 +459,9 @@ class Problem(SeminarModelBase):
|
|||
return force_unicode(u"%s.u%s" % (self.cislo_zadani.cislo, self.kod,))
|
||||
if self.typ == self.TYP_TEMA:
|
||||
return force_unicode(u"t%s" % (self.kod,))
|
||||
return ' Není zadaný '
|
||||
else:
|
||||
return force_unicode(self.kod)
|
||||
return u'<Není zadaný>'
|
||||
|
||||
def nazev_typu(self):
|
||||
return dict(self.TYP_CHOICES)[self.typ]
|
||||
|
|
|
@ -265,7 +265,14 @@ class CisloView(generic.DetailView):
|
|||
|
||||
resene_problemy = Problem.objects.filter(cislo_reseni=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_zadani__cislo', 'kod')
|
||||
|
||||
problemy = sorted(set(r.problem for r in reseni), key=lambda x:(0 if x.typ==Problem.TYP_ULOHA else 1, x.kod_v_rocniku()))
|
||||
poradi_typu = {
|
||||
Problem.TYP_ULOHA: 1,
|
||||
Problem.TYP_SERIAL: 2,
|
||||
Problem.TYP_ORG_CLANEK: 3,
|
||||
Problem.TYP_TEMA: 4,
|
||||
Problem.TYP_RES_CLANEK: 5
|
||||
}
|
||||
problemy = sorted(set(r.problem for r in reseni), key=lambda x:(poradi_typu[x.typ], x.kod_v_rocniku()))
|
||||
#setridi problemy podle typu a poradi zadani
|
||||
problem_index = {}
|
||||
for i in range(len(problemy)):
|
||||
|
|
Loading…
Reference in a new issue