diff --git a/seminar/migrations/0050_auto_20190510_2228.py b/seminar/migrations/0050_auto_20190510_2228.py index e0594be7..7efe52a7 100644 --- a/seminar/migrations/0050_auto_20190510_2228.py +++ b/seminar/migrations/0050_auto_20190510_2228.py @@ -164,7 +164,7 @@ class Migration(migrations.Migration): name='PohadkaNode', fields=[ ('treenode_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.TreeNode')), - ('pohadka', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Pohadka', verbose_name='pohádka')), + ('pohadka', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='seminar.Pohadka', verbose_name='pohádka')), ], options={ 'verbose_name': 'Pohádka (Node)', diff --git a/seminar/models.py b/seminar/models.py index a4c3211f..f867991a 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -1183,11 +1183,10 @@ class PohadkaNode(TreeNode): db_table = 'seminar_nodes_pohadka' verbose_name = 'Pohádka (Node)' verbose_name_plural = 'Pohádky (Node)' - pohadka = models.ForeignKey(Pohadka, - on_delete=models.PROTECT, # Pokud chci mazat téma, musím si Node pořešit ručně + pohadka = models.OneToOneField(Pohadka, + on_delete=models.PROTECT, # Pokud chci mazat pohádku, musím si Node pořešit ručně verbose_name = "pohádka", - null=True, - blank=False) + ) class UlohaVzorakNode(TreeNode): class Meta: