Browse Source

Update schematu a modelu dle aktualni situace.

Pridan CastNode
export_seznamu_prednasek
parent
commit
f18f5c900d
  1. BIN
      Schema_new.dia
  2. 32
      seminar/migrations/0077_auto_20200318_2146.py
  3. 10
      seminar/models.py

BIN
Schema_new.dia

Binary file not shown.

32
seminar/migrations/0077_auto_20200318_2146.py

@ -0,0 +1,32 @@
# Generated by Django 2.2.9 on 2020-03-18 20:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('seminar', '0076_auto_20200228_2013'),
]
operations = [
migrations.CreateModel(
name='CastNode',
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')),
('nadpis', models.CharField(help_text='Nadpis podvěšené části obsahu', max_length=100, verbose_name='Nadpis')),
],
options={
'verbose_name': 'Část (Node)',
'verbose_name_plural': 'Části (Node)',
'db_table': 'seminar_nodes_cast',
},
bases=('seminar.treenode',),
),
migrations.AlterField(
model_name='treenode',
name='first_child',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='father_of_first', to='seminar.TreeNode', verbose_name='první potomek'),
),
]

10
seminar/models.py

@ -1230,6 +1230,8 @@ class Obrazek(SeminarModelBase):
help_text = 'Černobílá verze obrázku do čísla',
upload_to = 'obrazky/%Y/%m/%d/', blank=True, null=True)
# TODO placement hint - chci ho tady / pred textem / za textem
class TreeNode(PolymorphicModel):
class Meta:
db_table = "seminar_nodes_treenode"
@ -1464,6 +1466,14 @@ class TextNode(TreeNode):
def getOdkazStr(self):
return str(self.text)
class CastNode(TreeNode):
class Meta:
db_table = 'seminar_nodes_cast'
verbose_name = 'Část (Node)'
verbose_name_plural = 'Části (Node)'
nadpis = models.CharField('Nadpis', max_length=100, help_text = 'Nadpis podvěšené části obsahu')
## FIXME: Logiku přesunout do views.
#class VysledkyBase(SeminarModelBase):

Loading…
Cancel
Save