From cfa005267362aaf14cde257019381f55a1120da1 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Thu, 21 Nov 2019 18:36:51 +0100 Subject: [PATCH] =?UTF-8?q?Nastavit=20ro=C4=8Dn=C3=ADk=20podle=20aktu?= =?UTF-8?q?=C3=A1ln=C3=ADho=20=C4=8D=C3=ADsla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/seminar/models.py b/seminar/models.py index 122f7c70..f7ef945c 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -1481,12 +1481,15 @@ class Nastaveni(SingletonModel): db_table = 'seminar_nastaveni' verbose_name = 'Nastavení semináře' - aktualni_rocnik = models.ForeignKey(Rocnik, verbose_name='aktuální ročník', - null=False, on_delete=models.PROTECT) +# aktualni_rocnik = models.ForeignKey(Rocnik, verbose_name='aktuální ročník', +# null=False, on_delete=models.PROTECT) aktualni_cislo = models.ForeignKey(Cislo, verbose_name='poslední vydané číslo', null=False, on_delete=models.PROTECT) + def aktualni_rocnik(self): + return self.aktualni_cislo.rocnik + def __str__(self): return 'Nastavení semináře'