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