Skip to content
Snippets Groups Projects
0040_districthomepage_menu.py 3.63 KiB
# Generated by Django 3.2.11 on 2022-03-09 08:35

import wagtail.blocks
import wagtail.fields
from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("district", "0039_alter_districtcustompage_content"),
    ]

    operations = [
        migrations.AddField(
            model_name="districthomepage",
            name="menu",
            field=wagtail.fields.StreamField(
                [
                    (
                        "menu_item",
                        wagtail.blocks.StructBlock(
                            [
                                (
                                    "title",
                                    wagtail.blocks.CharBlock(
                                        label="Titulek", required=True
                                    ),
                                ),
                                (
                                    "page",
                                    wagtail.blocks.PageChooserBlock(
                                        label="Stránka", required=False
                                    ),
                                ),
                                (
                                    "link",
                                    wagtail.blocks.URLBlock(
                                        label="Odkaz", required=False
                                    ),
                                ),
                            ]
                        ),
                    ),
                    (
                        "menu_parent",
                        wagtail.blocks.StructBlock(
                            [
                                (
                                    "title",
                                    wagtail.blocks.CharBlock(
                                        label="Titulek", required=True
                                    ),
                                ),
                                (
                                    "menu_items",
                                    wagtail.blocks.ListBlock(
                                        wagtail.blocks.StructBlock(
                                            [
                                                (
                                                    "title",
                                                    wagtail.blocks.CharBlock(
                                                        label="Titulek", required=True
                                                    ),
                                                ),
                                                (
                                                    "page",
                                                    wagtail.blocks.PageChooserBlock(
                                                        label="Stránka", required=False
                                                    ),
                                                ),
                                                (
                                                    "link",
                                                    wagtail.blocks.URLBlock(
                                                        label="Odkaz", required=False
                                                    ),
                                                ),
                                            ]
                                        )
                                    ),
                                ),
                            ]
                        ),
                    ),
                ],
                blank=True,
                verbose_name="Menu",
            ),
        ),
    ]