Merge branch 'data_migrations' of mam:/akce/mam/git/mamweb into data_migrations
This commit is contained in:
commit
d09bbb5d1a
4 changed files with 49 additions and 3 deletions
23
seminar/migrations/0070_auto_20191120_2357.py
Normal file
23
seminar/migrations/0070_auto_20191120_2357.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-20 22:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0069_auto_20191120_2115'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='tema',
|
||||
name='abstrakt',
|
||||
field=models.TextField(blank=True, verbose_name='Abstrakt na rozcestník'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='tema',
|
||||
name='obrazek',
|
||||
field=models.ImageField(null=True, upload_to='', verbose_name='Obrázek na rozcestník'),
|
||||
),
|
||||
]
|
17
seminar/migrations/0070_remove_nastaveni_aktualni_rocnik.py
Normal file
17
seminar/migrations/0070_remove_nastaveni_aktualni_rocnik.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-21 17:38
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('seminar', '0069_auto_20191120_2115'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='nastaveni',
|
||||
name='aktualni_rocnik',
|
||||
),
|
||||
]
|
|
@ -717,6 +717,9 @@ class Tema(Problem):
|
|||
rocnik = models.ForeignKey(Rocnik, verbose_name='ročník',blank=True, null=True,
|
||||
on_delete=models.PROTECT)
|
||||
|
||||
abstrakt = models.TextField('Abstrakt na rozcestník', blank=True)
|
||||
obrazek = models.ImageField('Obrázek na rozcestník', null=True)
|
||||
|
||||
def kod_v_rocniku(self):
|
||||
if self.stav == 'zadany':
|
||||
if self.nadproblem:
|
||||
|
@ -1481,12 +1484,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'
|
||||
|
||||
|
|
|
@ -600,5 +600,5 @@ def create_test_data(size = 6, rnd = None):
|
|||
|
||||
|
||||
# obecné nastavení semináře, musí být už přidané ročníky a čísla, jinak se nastaví divně
|
||||
nastaveni = Nastaveni.objects.create(aktualni_rocnik = Rocnik.objects.last(),
|
||||
nastaveni = Nastaveni.objects.create(
|
||||
aktualni_cislo = Cislo.objects.all()[1])
|
||||
|
|
Loading…
Reference in a new issue