From 666b455bbd0477201959bc861b127c5e8124d3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 31 Jul 2023 19:21:36 +0200 Subject: [PATCH] =?UTF-8?q?Vy=C5=99e=C5=A1en=C3=AD=20cyklick=C3=BDch=20imp?= =?UTF-8?q?ort=C5=AF=20po=20p=C5=99edchoz=C3=ADm=20commitu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/models/odevzdavatko.py | 7 +++++-- seminar/models/tvorba.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/seminar/models/odevzdavatko.py b/seminar/models/odevzdavatko.py index 77edee16..d4114b07 100644 --- a/seminar/models/odevzdavatko.py +++ b/seminar/models/odevzdavatko.py @@ -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 diff --git a/seminar/models/tvorba.py b/seminar/models/tvorba.py index 95db1823..352a38bd 100644 --- a/seminar/models/tvorba.py +++ b/seminar/models/tvorba.py @@ -23,7 +23,6 @@ from taggit.managers import TaggableManager from reversion import revisions as reversion -from seminar.utils import roman 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é) @@ -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 django.core.mail import EmailMessage -from seminar.utils import aktivniResitele from . import personalni as pm @@ -75,6 +73,7 @@ class Rocnik(SeminarModelBase): # Ročník v římských číslech def roman(self): + from seminar.utils import roman return roman(int(self.rocnik)) def verejne(self): @@ -280,6 +279,7 @@ class Cislo(SeminarModelBase): # Prijemci e-mailu + from seminar.utils import aktivniResitele resitele_vsichni = aktivniResitele(self).filter(zasilat_cislo_emailem=True) def posli(subject, text, resitele):