From f52b89f5139b7807e8127e74eb33ebbefb3897a7 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Wed, 6 May 2020 19:51:33 +0200 Subject: [PATCH 1/2] =?UTF-8?q?M=C3=ADsto=20ulo=C5=BEen=C3=AD=20n=C3=A1hle?= =?UTF-8?q?du=20titulky=20v=20separ=C3=A1tn=C3=AD=20migraci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/migrations/0082_auto_20200506_1951.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 seminar/migrations/0082_auto_20200506_1951.py diff --git a/seminar/migrations/0082_auto_20200506_1951.py b/seminar/migrations/0082_auto_20200506_1951.py new file mode 100644 index 00000000..3132c434 --- /dev/null +++ b/seminar/migrations/0082_auto_20200506_1951.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.12 on 2020-05-06 17:51 + +from django.db import migrations, models +import seminar.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0081_auto_20200408_2221'), + ] + + operations = [ + migrations.AlterField( + model_name='cislo', + name='titulka_nahled', + field=models.ImageField(blank=True, help_text='Obrázek titulní strany, generuje se automaticky', null=True, upload_to=seminar.models.cislo_png_filename, verbose_name='Obrázek titulní strany'), + ), + ] From 86f2e494c2b18f21c307e347ad1fd0d9b9619865 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Wed, 6 May 2020 19:52:27 +0200 Subject: [PATCH 2/2] TreeNode: first_child je 1-2-1-Field, ne FK. --- seminar/migrations/0083_auto_20200506_1952.py | 19 +++++++++++++++++++ seminar/models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 seminar/migrations/0083_auto_20200506_1952.py diff --git a/seminar/migrations/0083_auto_20200506_1952.py b/seminar/migrations/0083_auto_20200506_1952.py new file mode 100644 index 00000000..0c7fcf38 --- /dev/null +++ b/seminar/migrations/0083_auto_20200506_1952.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.12 on 2020-05-06 17:52 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0082_auto_20200506_1951'), + ] + + operations = [ + migrations.AlterField( + model_name='treenode', + name='first_child', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='father_of_first', to='seminar.TreeNode', verbose_name='první potomek'), + ), + ] diff --git a/seminar/models.py b/seminar/models.py index 57d4304a..43d6e59d 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -1246,7 +1246,7 @@ class TreeNode(PolymorphicModel): blank = False, on_delete = models.SET_NULL, # Vrcholy s null kořenem jsou sirotci bez ročníku verbose_name="kořen stromu") - first_child = models.ForeignKey('TreeNode', + first_child = models.OneToOneField('TreeNode', related_name='father_of_first', null = True, blank = True,