# Generated by Django 3.2.18 on 2023-07-24 11:38

import django.core.validators
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("builder", "0015_inputtextelement"),
    ]

    operations = [
        migrations.CreateModel(
            name="ColumnElement",
            fields=[
                (
                    "element_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="builder.element",
                    ),
                ),
                (
                    "column_amount",
                    models.IntegerField(
                        default=3,
                        help_text="The amount of columns inside this column element.",
                        validators=[
                            django.core.validators.MinValueValidator(
                                1, message="Value cannot be less than 0."
                            ),
                            django.core.validators.MaxValueValidator(
                                6, message="Value cannot be greater than 6."
                            ),
                        ],
                    ),
                ),
                (
                    "column_gap",
                    models.IntegerField(
                        default=30,
                        help_text="The amount of space between the columns.",
                        validators=[
                            django.core.validators.MinValueValidator(
                                0, message="Value cannot be less than 0."
                            ),
                            django.core.validators.MaxValueValidator(
                                2000, message="Value cannot be greater than 2000."
                            ),
                        ],
                    ),
                ),
                (
                    "alignment",
                    models.CharField(
                        choices=[
                            ("top", "Top"),
                            ("center", "Center"),
                            ("bottom", "Bottom"),
                        ],
                        default="top",
                        max_length=10,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=("builder.element",),
        ),
        migrations.AddField(
            model_name="element",
            name="parent_element",
            field=models.ForeignKey(
                default=None,
                help_text="The parent element, if inside a container.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="children",
                to="builder.element",
            ),
        ),
        migrations.AddField(
            model_name="element",
            name="place_in_container",
            field=models.CharField(
                blank=True,
                default=None,
                help_text="The place in the container.",
                max_length=255,
                null=True,
            ),
        ),
    ]
