# Generated by Django 4.2.11 on 2024-05-22 10:02

from django.db import migrations, models
import django.db.models.deletion
import uuid
import wagtail.blocks
import wagtailstreamforms.fields
import wagtailstreamforms.streamfield


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtailcore', '0089_log_entry_data_json_null_to_object'),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomFormSubmission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('form_data', models.TextField(verbose_name='Form data')),
                ('submit_time', models.DateTimeField(auto_now_add=True, verbose_name='Submit time')),
            ],
            options={
                'verbose_name': 'Form submission',
                'ordering': ['-submit_time'],
            },
        ),
        migrations.CreateModel(
            name='TranslatableForm',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('translation_key', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('title', models.CharField(max_length=255, verbose_name='Title')),
                ('slug', models.SlugField(allow_unicode=True, help_text='Used to identify the form in template tags', max_length=255, unique=True, verbose_name='Slug')),
                ('template_name', models.CharField(choices=[('streamforms/form_block.html', 'Default Form Template')], max_length=255, verbose_name='Template')),
                ('fields', wagtailstreamforms.streamfield.FormFieldsStreamField([('singleline', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='placeholder', label='Text field (single line)')), ('multiline', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='placeholder', label='Text field (multi line)')), ('date', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='date', label='Date field')), ('datetime', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='time', label='Time field')), ('email', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='mail', label='Email field')), ('url', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='link', label='URL field')), ('number', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='placeholder', label='Number field')), ('dropdown', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('empty_label', wagtail.blocks.CharBlock(required=False)), ('choices', wagtail.blocks.ListBlock(wagtail.blocks.CharBlock(label='Option')))], icon='arrow-down-big', label='Dropdown field')), ('radio', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('choices', wagtail.blocks.ListBlock(wagtail.blocks.CharBlock(label='Option')))], icon='radio-empty', label='Radio buttons')), ('checkboxes', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('choices', wagtail.blocks.ListBlock(wagtail.blocks.CharBlock(label='Option')))], icon='tick-inverse', label='Checkboxes')), ('checkbox', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False))], icon='tick-inverse', label='Checkbox field')), ('hidden', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False)), ('default_value', wagtail.blocks.CharBlock(required=False))], icon='no-view', label='Hidden field')), ('singlefile', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False))], icon='doc-full-inverse', label='File field')), ('multifile', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False)), ('required', wagtail.blocks.BooleanBlock(required=False))], icon='doc-full-inverse', label='Files field')), ('recaptcha', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock()), ('help_text', wagtail.blocks.CharBlock(required=False))], icon='success', label='ReCAPTCHA field'))], use_json_field=True, verbose_name='Fields')),
                ('submit_button_text', models.CharField(default='Submit', max_length=100, verbose_name='Submit button text')),
                ('success_message', models.CharField(blank=True, help_text='An optional success message to show when the form has been successfully submitted', max_length=255, verbose_name='Success message')),
                ('error_message', models.CharField(blank=True, help_text='An optional error message to show when the form has validation errors', max_length=255, verbose_name='Error message')),
                ('process_form_submission_hooks', wagtailstreamforms.fields.HookSelectField(blank=True, verbose_name='Submission hooks')),
                ('locale', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailcore.locale')),
                ('post_redirect_page', models.ForeignKey(blank=True, help_text='The page to redirect to after a successful submission', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.page', verbose_name='Post redirect page')),
                ('site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailcore.site')),
            ],
            options={
                'ordering': ['title'],
                'abstract': False,
                'unique_together': {('translation_key', 'locale')},
            },
        ),
        migrations.CreateModel(
            name='CustomFormSubmissionFile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('field', models.CharField(max_length=255, verbose_name='Field')),
                ('file', models.FileField(upload_to='streamforms/', verbose_name='File')),
                ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='wagtail_translatableforms.customformsubmission', verbose_name='Submission')),
            ],
            options={
                'verbose_name': 'Form submission file',
                'ordering': ['field', 'file'],
            },
        ),
        migrations.AddField(
            model_name='customformsubmission',
            name='form',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wagtail_translatableforms.translatableform', verbose_name='TranslatableForm'),
        ),
    ]
