Reset migrations, remove APIFields

This commit is contained in:
Daniel Egger 2022-06-14 10:56:32 +02:00
parent c26a3091bb
commit 1705faee6e
2 changed files with 17 additions and 27 deletions

View File

@ -1,4 +1,4 @@
# Generated by Django 3.2.13 on 2022-06-08 12:08 # Generated by Django 3.2.13 on 2022-06-14 08:51
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
@ -17,6 +17,20 @@ class Migration(migrations.Migration):
] ]
operations = [ operations = [
migrations.CreateModel(
name='Circle',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('description', models.TextField(blank=True, default='')),
('goals', wagtail.fields.StreamField([('goal', wagtail.blocks.TextBlock())], use_json_field=True)),
('job_situations', wagtail.fields.StreamField([('job_situation', wagtail.blocks.CharBlock())], use_json_field=True)),
('experts', wagtail.fields.StreamField([('person', wagtail.blocks.StructBlock([('first_name', wagtail.blocks.CharBlock()), ('last_name', wagtail.blocks.CharBlock()), ('email', wagtail.blocks.EmailBlock()), ('photo', wagtail.images.blocks.ImageChooserBlock(required=False)), ('biography', wagtail.blocks.RichTextBlock(required=False))]))], use_json_field=True)),
],
options={
'verbose_name': 'Circle',
},
bases=('wagtailcore.page',),
),
migrations.CreateModel( migrations.CreateModel(
name='Competence', name='Competence',
fields=[ fields=[
@ -86,15 +100,13 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='Topic', name='Topic',
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
('title', models.TextField(default='')),
('is_visible', models.BooleanField(default=True)), ('is_visible', models.BooleanField(default=True)),
('learning_path', modelcluster.fields.ParentalKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='topics', to='learnpath.learningpath')),
], ],
options={ options={
'verbose_name': 'Topic', 'verbose_name': 'Topic',
}, },
bases=('wagtailcore.page',),
), ),
migrations.CreateModel( migrations.CreateModel(
name='FullfillmentCriteria', name='FullfillmentCriteria',
@ -113,19 +125,4 @@ class Migration(migrations.Migration):
name='competence_page', name='competence_page',
field=modelcluster.fields.ParentalKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='competences', to='learnpath.competencepage'), field=modelcluster.fields.ParentalKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='competences', to='learnpath.competencepage'),
), ),
migrations.CreateModel(
name='Circle',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('description', models.TextField(blank=True, default='')),
('goals', wagtail.fields.StreamField([('goal', wagtail.blocks.TextBlock())], use_json_field=True)),
('job_situations', wagtail.fields.StreamField([('job_situation', wagtail.blocks.CharBlock())], use_json_field=True)),
('experts', wagtail.fields.StreamField([('person', wagtail.blocks.StructBlock([('first_name', wagtail.blocks.CharBlock()), ('last_name', wagtail.blocks.CharBlock()), ('email', wagtail.blocks.EmailBlock()), ('photo', wagtail.images.blocks.ImageChooserBlock(required=False)), ('biography', wagtail.blocks.RichTextBlock(required=False))]))], use_json_field=True)),
('topic', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='circles', to='learnpath.topic')),
],
options={
'verbose_name': 'Circle',
},
bases=('wagtailcore.page',),
),
] ]

View File

@ -2,7 +2,6 @@
from django.utils.text import slugify from django.utils.text import slugify
from wagtail import blocks from wagtail import blocks
from wagtail.api import APIField
from wagtail.blocks import StreamBlock from wagtail.blocks import StreamBlock
from wagtail.fields import StreamField from wagtail.fields import StreamField
from wagtail.images.blocks import ImageChooserBlock from wagtail.images.blocks import ImageChooserBlock
@ -37,11 +36,6 @@ class Topic(Page):
FieldPanel('is_visible'), FieldPanel('is_visible'),
] ]
api_fields = [
APIField('title'),
APIField('is_visible'),
]
# content_panels = Page.content_panels + [ # content_panels = Page.content_panels + [
# FieldPanel('is_visible', classname="full"), # FieldPanel('is_visible', classname="full"),
# PageChooserPanel('learning_path', 'learnpath.LearningPath'), # PageChooserPanel('learning_path', 'learnpath.LearningPath'),
@ -98,7 +92,6 @@ class Circle(Page):
FieldPanel('goals'), FieldPanel('goals'),
FieldPanel('job_situations'), FieldPanel('job_situations'),
FieldPanel('experts'), FieldPanel('experts'),
APIField('learning_sequences'),
] ]
@property @property