V moduly.py pridana Resiteli funkce titul v zavislosti na poctu bodu.
Pouzito ve views.py pro generovani vysledkovky. Anet
This commit is contained in:
parent
bd16b0db9e
commit
f57cf71b14
2 changed files with 18 additions and 1 deletions
|
@ -218,7 +218,23 @@ class Resitel(SeminarModelBase):
|
||||||
else:
|
else:
|
||||||
return 5 - rozdil
|
return 5 - rozdil
|
||||||
|
|
||||||
#def titul(self):
|
def titul(self, celkove_body):
|
||||||
|
"Vrati titul podle zadaneho poctu bodu."
|
||||||
|
if celkove_body < 10:
|
||||||
|
return None
|
||||||
|
elif celkove_body < 20:
|
||||||
|
return 'Bc.'
|
||||||
|
elif celkove_body < 50:
|
||||||
|
return 'Mgr.'
|
||||||
|
elif celkove_body < 100:
|
||||||
|
return 'Dr.'
|
||||||
|
elif celkove_body < 200:
|
||||||
|
return 'Doc.'
|
||||||
|
elif celkove_body < 500:
|
||||||
|
return 'Prof.'
|
||||||
|
else:
|
||||||
|
return 'Akad.'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@reversion.register(ignore_duplicate_revisions=True)
|
@reversion.register(ignore_duplicate_revisions=True)
|
||||||
|
|
|
@ -97,6 +97,7 @@ class CisloView(generic.DetailView):
|
||||||
tv = RadekVysledkovky()
|
tv = RadekVysledkovky()
|
||||||
tv.resitel = v.resitel
|
tv.resitel = v.resitel
|
||||||
tv.rocnik = tv.resitel.rocnik(context['cislo'].datum_vydani)
|
tv.rocnik = tv.resitel.rocnik(context['cislo'].datum_vydani)
|
||||||
|
tv.resitel.titul = tv.resitel.titul(v.body_celkem)
|
||||||
tv.vysledek = v
|
tv.vysledek = v
|
||||||
#odkazuje na VysledkyKCislu
|
#odkazuje na VysledkyKCislu
|
||||||
tv.body = ['']*len(problemy)
|
tv.body = ['']*len(problemy)
|
||||||
|
|
Loading…
Reference in a new issue