|
|
@ -14,8 +14,6 @@ from seminar.models.personalni import Resitel |
|
|
|
from seminar.models.treenode import TreeNode |
|
|
|
from seminar.models.base import SeminarModelBase |
|
|
|
|
|
|
|
from seminar.utils import vzorecek_na_prepocet, inverze_vzorecku_na_prepocet |
|
|
|
|
|
|
|
|
|
|
|
@reversion.register(ignore_duplicates=True) |
|
|
|
class Reseni(SeminarModelBase): |
|
|
@ -138,6 +136,7 @@ class Hodnoceni(SeminarModelBase): |
|
|
|
def body_neprepocitane(self): |
|
|
|
if self.body is None: |
|
|
|
return None |
|
|
|
from seminar.utils import inverze_vzorecku_na_prepocet |
|
|
|
return inverze_vzorecku_na_prepocet(self.body, self.reseni.resitele.count()) |
|
|
|
|
|
|
|
@body_neprepocitane.setter |
|
|
@ -145,12 +144,14 @@ class Hodnoceni(SeminarModelBase): |
|
|
|
if value is None: |
|
|
|
self.body = None |
|
|
|
else: |
|
|
|
from seminar.utils import vzorecek_na_prepocet |
|
|
|
self.body = vzorecek_na_prepocet(value, self.reseni.resitele.count()) |
|
|
|
|
|
|
|
@property |
|
|
|
def body_neprepocitane_celkem(self): |
|
|
|
if self.body_celkem is None: |
|
|
|
return None |
|
|
|
from seminar.utils import inverze_vzorecku_na_prepocet |
|
|
|
return inverze_vzorecku_na_prepocet(self.body_celkem, self.reseni.resitele.count()) |
|
|
|
|
|
|
|
@body_neprepocitane_celkem.setter |
|
|
@ -158,12 +159,14 @@ class Hodnoceni(SeminarModelBase): |
|
|
|
if value is None: |
|
|
|
self.body = None |
|
|
|
else: |
|
|
|
from seminar.utils import vzorecek_na_prepocet |
|
|
|
self.body_celkem = vzorecek_na_prepocet(value, self.reseni.resitele.count()) |
|
|
|
|
|
|
|
@property |
|
|
|
def body_max(self): |
|
|
|
if self.body_neprepocitane_max is None: |
|
|
|
return None |
|
|
|
from seminar.utils import vzorecek_na_prepocet |
|
|
|
return vzorecek_na_prepocet(self.body_neprepocitane_max, self.reseni.resitele.count()) |
|
|
|
|
|
|
|
@property |
|
|
|