Browse Source

Update modelu - Nody

export_seznamu_prednasek
parent
commit
2f50906e6f
  1. BIN
      Schema_new.dia
  2. 48
      seminar/migrations/0050_auto_20190510_2228.py
  3. 34
      seminar/models.py

BIN
Schema_new.dia

Binary file not shown.

48
seminar/migrations/0050_auto_20190510_2228.py

@ -112,19 +112,53 @@ class Migration(migrations.Migration):
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name='UlohaNode', name='UlohaVzorakNode',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_child', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.UlohaNode', verbose_name='první potomek')), ('first_child', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.UlohaVzorakNode', verbose_name='první potomek')),
('root', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='potomci_set', to='seminar.UlohaNode', verbose_name='kořen stromu')), ('root', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='potomci_set', to='seminar.UlohaVzorakNode', verbose_name='kořen stromu')),
('succ', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='prev', to='seminar.UlohaNode', verbose_name='další element na stejné úrovni')), ('succ', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='prev', to='seminar.UlohaVzorakNode', verbose_name='další element na stejné úrovni')),
], ],
options={ options={
'verbose_name': 'Úloha (Node)', 'verbose_name': 'Vzorák úlohy (Node)',
'verbose_name_plural': 'Úlohy (Node)', 'verbose_name_plural': 'Vzoráky úloh (Node)',
'db_table': 'seminar_nodes_uloha', 'db_table': 'seminar_nodes_uloha_vzorak',
}, },
), ),
migrations.CreateModel(
name='UlohaZadaniNode',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_child', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.UlohaZadaniNode', verbose_name='první potomek')),
('root', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='potomci_set', to='seminar.UlohaZadaniNode', verbose_name='kořen stromu')),
('succ', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='prev', to='seminar.UlohaZadaniNode', verbose_name='další element na stejné úrovni')),
],
options={
'verbose_name': 'Zadání úlohy (Node)',
'verbose_name_plural': 'Zadání úloh (Node)',
'db_table': 'seminar_nodes_uloha_zadani',
},
),
migrations.AddField(
model_name='claneknode',
name='clanek',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Clanek', verbose_name='článek'),
),
migrations.AddField(
model_name='konferanode',
name='konfera',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Konfera', verbose_name='konfera'),
),
migrations.AddField(
model_name='ulohavzoraknode',
name='uloha',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Uloha', verbose_name='úloha'),
),
migrations.AddField(
model_name='ulohazadaninode',
name='uloha',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Uloha', verbose_name='úloha'),
),
migrations.AlterField( migrations.AlterField(
model_name='konfera', model_name='konfera',
name='reseni', name='reseni',

34
seminar/models.py

@ -1144,18 +1144,44 @@ class KonferaNode(TreeNode):
db_table = 'seminar_nodes_konfera' db_table = 'seminar_nodes_konfera'
verbose_name = 'Konfera (Node)' verbose_name = 'Konfera (Node)'
verbose_name_plural = 'Konfery (Node)' verbose_name_plural = 'Konfery (Node)'
konfera = models.ForeignKey(Konfera,
on_delete=models.PROTECT, # Pokud chci mazat téma, musím si Node pořešit ručně
verbose_name = "konfera",
null=True,
blank=False)
class ClanekNode(TreeNode): class ClanekNode(TreeNode):
class Meta: class Meta:
db_table = 'seminar_nodes_clanek' db_table = 'seminar_nodes_clanek'
verbose_name = 'Článek (Node)' verbose_name = 'Článek (Node)'
verbose_name_plural = 'Články (Node)' verbose_name_plural = 'Články (Node)'
clanek = models.ForeignKey(Clanek,
on_delete=models.PROTECT, # Pokud chci mazat téma, musím si Node pořešit ručně
verbose_name = "článek",
null=True,
blank=False)
class UlohaZadaniNode(TreeNode):
class Meta:
db_table = 'seminar_nodes_uloha_zadani'
verbose_name = 'Zadání úlohy (Node)'
verbose_name_plural = 'Zadání úloh (Node)'
uloha = models.ForeignKey(Uloha,
on_delete=models.PROTECT, # Pokud chci mazat téma, musím si Node pořešit ručně
verbose_name = "úloha",
null=True,
blank=False)
class UlohaNode(TreeNode): class UlohaVzorakNode(TreeNode):
class Meta: class Meta:
db_table = 'seminar_nodes_uloha' db_table = 'seminar_nodes_uloha_vzorak'
verbose_name = 'Úloha (Node)' verbose_name = 'Vzorák úlohy (Node)'
verbose_name_plural = 'Úlohy (Node)' verbose_name_plural = 'Vzoráky úloh (Node)'
uloha = models.ForeignKey(Uloha,
on_delete=models.PROTECT, # Pokud chci mazat téma, musím si Node pořešit ručně
verbose_name = "úloha",
null=True,
blank=False)
class TextNode(TreeNode): class TextNode(TreeNode):
class Meta: class Meta:

Loading…
Cancel
Save