Vyřešení cyklických importů po předchozím commitu
This commit is contained in:
parent
e45c819424
commit
666b455bbd
2 changed files with 7 additions and 4 deletions
|
@ -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
|
||||||
|
|
|
@ -23,7 +23,6 @@ from taggit.managers import TaggableManager
|
||||||
|
|
||||||
from reversion import revisions as reversion
|
from reversion import revisions as reversion
|
||||||
|
|
||||||
from seminar.utils import roman
|
|
||||||
from treenode import treelib
|
from treenode import treelib
|
||||||
|
|
||||||
from unidecode import unidecode # Používám pro získání ID odkazu (ještě je to někde po někom zakomentované)
|
from unidecode import unidecode # Používám pro získání ID odkazu (ještě je to někde po někom zakomentované)
|
||||||
|
@ -31,7 +30,6 @@ from unidecode import unidecode # Používám pro získání ID odkazu (ještě
|
||||||
from polymorphic.models import PolymorphicModel
|
from polymorphic.models import PolymorphicModel
|
||||||
|
|
||||||
from django.core.mail import EmailMessage
|
from django.core.mail import EmailMessage
|
||||||
from seminar.utils import aktivniResitele
|
|
||||||
|
|
||||||
from . import personalni as pm
|
from . import personalni as pm
|
||||||
|
|
||||||
|
@ -75,6 +73,7 @@ class Rocnik(SeminarModelBase):
|
||||||
|
|
||||||
# Ročník v římských číslech
|
# Ročník v římských číslech
|
||||||
def roman(self):
|
def roman(self):
|
||||||
|
from seminar.utils import roman
|
||||||
return roman(int(self.rocnik))
|
return roman(int(self.rocnik))
|
||||||
|
|
||||||
def verejne(self):
|
def verejne(self):
|
||||||
|
@ -280,6 +279,7 @@ class Cislo(SeminarModelBase):
|
||||||
|
|
||||||
|
|
||||||
# Prijemci e-mailu
|
# Prijemci e-mailu
|
||||||
|
from seminar.utils import aktivniResitele
|
||||||
resitele_vsichni = aktivniResitele(self).filter(zasilat_cislo_emailem=True)
|
resitele_vsichni = aktivniResitele(self).filter(zasilat_cislo_emailem=True)
|
||||||
|
|
||||||
def posli(subject, text, resitele):
|
def posli(subject, text, resitele):
|
||||||
|
|
Loading…
Reference in a new issue