Pohádka má být OneToOneField

This commit is contained in:
Pavel "LEdoian" Turinsky 2019-05-30 01:41:11 +02:00
parent 00d16bd25f
commit 7d84285e86
2 changed files with 4 additions and 5 deletions

View file

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

View file

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