# Generated by Django 5.1.4 on 2024-12-19 01:11

import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
import wagtail.fields
from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("taggit", "0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx"),
        ("wagtailcore", "0094_alter_page_locale"),
    ]

    operations = [
        migrations.CreateModel(
            name="Article",
            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",
                    ),
                ),
                (
                    "summary",
                    wagtail.fields.RichTextField(
                        blank=True, help_text="A short summary, or tagline for the article."
                    ),
                ),
                (
                    "content",
                    wagtail.fields.StreamField(
                        [("section", 5), ("image", 3)],
                        blank=True,
                        block_lookup={
                            0: (
                                "wagtail.blocks.CharBlock",
                                (),
                                {"help_text": "Heading for this section.", "required": True},
                            ),
                            1: (
                                "wagtail.blocks.IntegerBlock",
                                (),
                                {
                                    "help_text": "Heading level",
                                    "max_value": 6,
                                    "min_value": 1,
                                    "required": True,
                                },
                            ),
                            2: (
                                "wagtail.blocks.RichTextBlock",
                                (),
                                {
                                    "features": [
                                        "bold",
                                        "italic",
                                        "link",
                                        "ul",
                                        "ol",
                                        "document-link",
                                    ]
                                },
                            ),
                            3: ("wagtail.images.blocks.ImageChooserBlock", (), {}),
                            4: (
                                "wagtail.blocks.StreamBlock",
                                [[("rich_text", 2), ("image", 3)]],
                                {
                                    "help_text": "Content blocks for this section.",
                                    "required": False,
                                },
                            ),
                            5: (
                                "wagtail.blocks.StructBlock",
                                [[("heading", 0), ("level", 1), ("content", 4)]],
                                {},
                            ),
                        },
                        help_text="Main content for the article.",
                    ),
                ),
            ],
            options={
                "verbose_name": "Article",
                "verbose_name_plural": "Articles",
            },
            bases=("wagtailcore.page",),
        ),
        migrations.CreateModel(
            name="ArticleTag",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(max_length=100, unique=True, verbose_name="name")),
                (
                    "slug",
                    models.SlugField(
                        allow_unicode=True, max_length=100, unique=True, verbose_name="slug"
                    ),
                ),
            ],
            options={
                "verbose_name": "Article Tag",
                "verbose_name_plural": "Article Tags",
            },
        ),
        migrations.CreateModel(
            name="ArticleType",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="Name of the article type.", max_length=100, unique=True
                    ),
                ),
                (
                    "name_plural",
                    models.CharField(
                        blank=True,
                        help_text="Plural form of the article type name (optional). Defaults to appending 's'.",  # noqa: E501
                        max_length=100,
                    ),
                ),
                ("slug", models.SlugField(max_length=100, unique=True)),
                (
                    "description",
                    models.TextField(blank=True, help_text="Optional description of this type."),
                ),
            ],
        ),
        migrations.CreateModel(
            name="BasicPage",
            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",
                    ),
                ),
                (
                    "content",
                    wagtail.fields.StreamField(
                        [("rich_text", 0), ("image", 1)],
                        blank=True,
                        block_lookup={
                            0: ("wagtail.blocks.RichTextBlock", (), {}),
                            1: ("wagtail.images.blocks.ImageChooserBlock", (), {}),
                        },
                        help_text="Main content for the page.",
                    ),
                ),
            ],
            options={
                "verbose_name": "Basic Page",
                "verbose_name_plural": "Basic Pages",
            },
            bases=("wagtailcore.page",),
        ),
        migrations.CreateModel(
            name="PostGroupPage",
            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",
                    ),
                ),
                (
                    "intro",
                    wagtail.fields.RichTextField(
                        blank=True, help_text="An optional introduction to this group."
                    ),
                ),
            ],
            options={
                "verbose_name": "Post Group",
                "verbose_name_plural": "Post Groups",
            },
            bases=("wagtailcore.page",),
        ),
        migrations.CreateModel(
            name="ArticleTagItem",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "content_object",
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="tagged_items",
                        to="hpk.article",
                    ),
                ),
                (
                    "tag",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="%(app_label)s_%(class)s_items",
                        to="taggit.tag",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="article",
            name="tags",
            field=modelcluster.contrib.taggit.ClusterTaggableManager(
                blank=True,
                help_text="Tags for the article.",
                through="hpk.ArticleTagItem",
                to="taggit.Tag",
                verbose_name="Tags",
            ),
        ),
        migrations.AddField(
            model_name="article",
            name="article_type",
            field=models.ForeignKey(
                blank=True,
                help_text="Select the type of article.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="articles",
                to="hpk.articletype",
            ),
        ),
    ]
