Browse Source

Pohádka má být OneToOneField

export_seznamu_prednasek
Pavel "LEdoian" Turinsky 6 years ago
parent
commit
7d84285e86
  1. 2
      seminar/migrations/0050_auto_20190510_2228.py
  2. 7
      seminar/models.py

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

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

Loading…
Cancel
Save