Model PohádkaNode + úprava příslušné migrace, která vytváří *Node
This commit is contained in:
parent
c1bd65fe68
commit
77cbe6ed31
2 changed files with 24 additions and 0 deletions
|
@ -160,6 +160,19 @@ class Migration(migrations.Migration):
|
||||||
},
|
},
|
||||||
bases=('seminar.treenode',),
|
bases=('seminar.treenode',),
|
||||||
),
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
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')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name': 'Pohádka (Node)',
|
||||||
|
'verbose_name_plural': 'Pohádky (Node)',
|
||||||
|
'db_table': 'seminar_nodes_pohadka',
|
||||||
|
},
|
||||||
|
bases=('seminar.treenode',),
|
||||||
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='treenode',
|
model_name='treenode',
|
||||||
name='first_child',
|
name='first_child',
|
||||||
|
|
|
@ -1178,6 +1178,17 @@ class UlohaZadaniNode(TreeNode):
|
||||||
null=True,
|
null=True,
|
||||||
blank=False)
|
blank=False)
|
||||||
|
|
||||||
|
class PohadkaNode(TreeNode):
|
||||||
|
class Meta:
|
||||||
|
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ě
|
||||||
|
verbose_name = "pohádka",
|
||||||
|
null=True,
|
||||||
|
blank=False)
|
||||||
|
|
||||||
class UlohaVzorakNode(TreeNode):
|
class UlohaVzorakNode(TreeNode):
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'seminar_nodes_uloha_vzorak'
|
db_table = 'seminar_nodes_uloha_vzorak'
|
||||||
|
|
Loading…
Reference in a new issue