Browse Source

Merge branch 'data_migrations' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into data_migrations

export_seznamu_prednasek
Anet 5 years ago
parent
commit
f29f25ef21
  1. 2
      seminar/migrations/0001_squashed_0067_auto_20190814_0805.py
  2. 23
      seminar/migrations/0070_auto_20191120_2357.py
  3. 17
      seminar/migrations/0071_remove_nastaveni_aktualni_rocnik.py
  4. 10
      seminar/models.py
  5. 2
      seminar/testutils.py

2
seminar/migrations/0001_squashed_0067_auto_20190814_0805.py

@ -510,7 +510,7 @@ def vyrob_problemum_ctypes(apps, schema_editor):
class Migration(migrations.Migration):
atomic = False
replaces = [('seminar', '0001_initial'), ('seminar', '0002_add_body_views'), ('seminar', '0003_add_skola_zs_ss'), ('seminar', '0004_add_old_dakos_id'), ('seminar', '0005_alter_problem_autor'), ('seminar', '0006_problem_add_timestamp'), ('seminar', '0007_problem_zamereni'), ('seminar', '0008_reseni_forma'), ('seminar', '0009_rename_imported_IDs'), ('seminar', '0010_alter_rok_maturity'), ('seminar', '0011_alter_timestamp_def'), ('seminar', '0012_remove_soustredeni_ucastnici'), ('seminar', '0013_soustredeni_ucastnici_through_model'), ('seminar', '0014_uprava_poznamek'), ('seminar', '0015_soustredeni_text'), ('seminar', '0016_texty_problemu'), ('seminar', '0017_texty_problemu_minor'), ('seminar', '0018_problemnavrh_problemzadany'), ('seminar', '0019_rocnik_ciselne'), ('seminar', '0020_indexy_a_razeni'), ('seminar', '0021_cislo_verejna_vysledkovka'), ('seminar', '0022_decimal_body'), ('seminar', '0023_add_novinky'), ('seminar', '0024_add_organizator'), ('seminar', '0025_zmena_cesty_nahravani_obrazku'), ('seminar', '0026_soustredeni_typ'), ('seminar', '0027_export_flag_a_typ_akce'), ('seminar', '0028_add_body_celkem_views'), ('seminar', '0029_fix_body_celkem_views'), ('seminar', '0030_add_vysledky'), ('seminar', '0031_cislo_pdf'), ('seminar', '0032_cislo_pdf_blank_typos'), ('seminar', '0033_organizator_studuje_popisek'), ('seminar', '0034_reseni_forma_default_email'), ('seminar', '0035_django_imagekit'), ('seminar', '0036_add_org_to_soustredeni'), ('seminar', '0037_prispevek'), ('seminar', '0038_change_meta_prispevek'), ('seminar', '0039_pohadka'), ('seminar', '0040_pohadka_nepovinny_autor'), ('seminar', '0041_konfery'), ('seminar', '0042_cislo_faze'), ('seminar', '0043_uprava_faze'), ('seminar', '0044_uprava_faze'), ('seminar', '0045_cislo_pridani_faze_nahrano'), ('seminar', '0042_auto_20161005_0847'), ('seminar', '0046_merge'), ('seminar', '0047_auto_20170120_2118'), ('seminar', '0048_add_cislo_datum_deadline_soustredeni'), ('seminar', '0049_auto_20190430_2354'), ('seminar', '0050_auto_20190510_2228'), ('seminar', '0051_resitel_to_osoba'), ('seminar', '0052_user_to_organizator'), ('seminar', '0053_organizator_organizuje_od_do'), ('seminar', '0055_smazat_nemigrovane_zastarale_veci'), ('seminar', '0056_vrcholy_pro_rocniky_a_cisla'), ('seminar', '0057_reseni_to_reseni_hodnoceni'), ('seminar', '0058_problem_to_uloha_tema_clanek'), ('seminar', '0059_vytvorit_pohadkanode'), ('seminar', '0060_spoj_stromy'), ('seminar', '0061_kill_frankenstein'), ('seminar', '0062_redukce_modelu_pohadky'), ('seminar', '0063_procisteni_migraci'), ('seminar', '0064_auto_20190610_2358'), ('seminar', '0065_treenode_polymorphic_ctype'), ('seminar', '0066_problem_polymorphic_ctype'), ('seminar', '0067_auto_20190814_0805')]
initial = True

23
seminar/migrations/0070_auto_20191120_2357.py

@ -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/0071_remove_nastaveni_aktualni_rocnik.py

@ -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', '0070_auto_20191120_2357'),
]
operations = [
migrations.RemoveField(
model_name='nastaveni',
name='aktualni_rocnik',
),
]

10
seminar/models.py

@ -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'

2
seminar/testutils.py

@ -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…
Cancel
Save