# Generated by Django 4.1.9 on 2023-05-12 14:58

import be_brief.categories
import be_brief.model_fields
import be_brief.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_auxiliaries.servable
import django_auxiliaries.variable_scope
import modelcluster.contrib.taggit
import modelcluster.fields
import tour_guide.model_fields
import uuid
import wagtail.contrib.routable_page.models
import wagtail.models
import wagtail_block_model_field.fields
import wagtail_dynamic_choice.model_fields
import wagtail_preference_blocks.blocks


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('wagtail_synopsis', '0001_initial'),
        ('wagtailcore', '0078_referenceindex'),
        ('officekit', '0002_add_address_formats'),
    ]

    operations = [
        migrations.CreateModel(
            name='BeBriefSiteSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('site', models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.site')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('translation_key', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('has_unpublished_changes', models.BooleanField(default=False, editable=False, verbose_name='has unpublished changes')),
                ('first_published_at', models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='first published at')),
                ('last_published_at', models.DateTimeField(editable=False, null=True, verbose_name='last published at')),
                ('go_live_at', models.DateTimeField(blank=True, null=True, verbose_name='go live date/time')),
                ('expire_at', models.DateTimeField(blank=True, null=True, verbose_name='expiry date/time')),
                ('expired', models.BooleanField(default=False, editable=False, verbose_name='expired')),
                ('year', models.PositiveIntegerField(default=0, editable=False)),
                ('month', models.PositiveSmallIntegerField(default=0, editable=False)),
                ('day', models.PositiveSmallIntegerField(default=0, editable=False)),
                ('category', wagtail_dynamic_choice.model_fields.DynamicChoiceField(choices_function_name='be_brief.categories.get_post_category_choices', default='', max_length=128, validators=[be_brief.categories.validate_category])),
                ('live', models.BooleanField(default=False, verbose_name='live')),
                ('slug', models.SlugField(allow_unicode=True, help_text='The name of the post as it will appear in URLs', max_length=255, verbose_name='slug')),
                ('content', be_brief.model_fields.PostContentField(blank=True, default='[]', help_text='A content of the contents of this content.')),
                ('title', models.CharField(help_text="The content title as you'd like it to be seen by the public", max_length=255, verbose_name='title')),
                ('seo_title', models.CharField(blank=True, help_text='The name of the page displayed on search engine results as the clickable headline.', max_length=255, verbose_name='title tag')),
                ('search_description', models.TextField(blank=True, help_text='The descriptive text displayed underneath a headline in search engine results.', verbose_name='meta content')),
                ('preferences_context', wagtail_block_model_field.fields.BlockModelField(wagtail_preference_blocks.blocks.PreferencesContextBlock(label='Preferences Context'), wagtail_preference_blocks.blocks.PreferencesContext, verbose_name='Preferences')),
                ('created_by_user', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='created by user')),
                ('latest_revision', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.revision', verbose_name='latest revision')),
                ('live_revision', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.revision', verbose_name='live revision')),
                ('locale', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailcore.locale')),
            ],
            bases=(django_auxiliaries.variable_scope.WagtailPageMixin, models.Model, wagtail.models.PreviewableMixin, django_auxiliaries.servable.Servable),
        ),
        migrations.CreateModel(
            name='PostIndexPage',
            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')),
                ('template', models.CharField(blank=True, max_length=128, null=True, validators=[be_brief.models.validate_file_name], verbose_name='Template Path')),
                ('category', wagtail_dynamic_choice.model_fields.DynamicChoiceField(choices_function_name='be_brief.categories.get_post_category_choices', default='', max_length=128, validators=[be_brief.categories.validate_category])),
                ('navigation_categories', tour_guide.model_fields.NavigationCategoriesField(blank=True, choices_function_name='tour_guide.categories.navigation_category_choices', max_length=128, verbose_name='Navigation Categories')),
            ],
            options={
                'verbose_name': 'Post Index Page',
                'verbose_name_plural': 'Post Index Pages',
            },
            bases=(wagtail.contrib.routable_page.models.RoutablePageMixin, 'wagtailcore.page', models.Model),
        ),
        migrations.CreateModel(
            name='PostTag',
            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': 'content tag',
                'verbose_name_plural': 'content tags',
            },
        ),
        migrations.CreateModel(
            name='PostTagItem',
            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='be_brief.post')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_post', to='be_brief.posttag')),
            ],
            options={
                'unique_together': {('content_object', 'tag')},
            },
        ),
        migrations.CreateModel(
            name='PostSynopsis',
            fields=[
                ('synopsis_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtail_synopsis.synopsis')),
                ('model', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='synopsis', to='be_brief.post')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
            bases=('wagtail_synopsis.synopsis',),
        ),
        migrations.AddField(
            model_name='post',
            name='tags',
            field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='be_brief.PostTagItem', to='be_brief.PostTag', verbose_name='Tags'),
        ),
        migrations.CreateModel(
            name='PostCategoryIndexPageSetting',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
                ('category', wagtail_dynamic_choice.model_fields.DynamicChoiceField(choices_function_name='be_brief.categories.get_post_category_choices', default='', max_length=128, validators=[be_brief.categories.validate_category])),
                ('canonical_index_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='be_brief.postindexpage')),
                ('site_setting', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='post_category_index_pages', to='be_brief.bebriefsitesettings')),
            ],
            options={
                'verbose_name': 'Post Category Index Page',
                'verbose_name_plural': 'Post Category Index Pages',
                'ordering': ['sort_order'],
                'abstract': False,
                'unique_together': {('site_setting', 'category')},
            },
        ),
        migrations.CreateModel(
            name='PostAuthor',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts', to='officekit.groupmember')),
                ('post', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='authors', to='be_brief.post')),
            ],
            options={
                'verbose_name': 'Author in Post',
                'verbose_name_plural': 'Authors in Post',
                'ordering': ['sort_order'],
                'abstract': False,
                'unique_together': {('author', 'post')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='post',
            unique_together={('slug', 'locale'), ('translation_key', 'locale')},
        ),
    ]
