# Generated by Django 3.2.16 on 2023-01-04 09:47

import agir.events.models
import agir.lib.model_fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):
    dependencies = [
        ("people", "0018_person_crp"),
    ]

    operations = [
        migrations.CreateModel(
            name="Qualification",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "label",
                    models.CharField(max_length=50, unique=True, verbose_name="nom"),
                ),
                (
                    "description",
                    models.TextField(blank=True, verbose_name="description"),
                ),
            ],
            options={
                "verbose_name": "type de statut",
                "verbose_name_plural": "types de statuts",
            },
        ),
        migrations.AlterField(
            model_name="person",
            name="newsletters",
            field=agir.lib.model_fields.ChoiceArrayField(
                base_field=models.CharField(
                    choices=[
                        ("LFI", "Lettre d'information de la France insoumise"),
                        ("LJI", "Informations jeunes insoumis"),
                        ("2022", "Lettre d'information NSP"),
                        ("2022_exceptionnel", "NSP : informations exceptionnelles"),
                        ("2022_en_ligne", "NSP actions en ligne"),
                        ("2022_chez_moi", "NSP agir près de chez moi"),
                        ("2022_programme", "NSP processus programme"),
                        ("2022_liaison", "NSP Correspondant·e d'immeuble ou de rue"),
                    ],
                    max_length=255,
                ),
                blank=True,
                default=list,
                size=None,
            ),
        ),
        migrations.CreateModel(
            name="PersonQualification",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        editable=False,
                        verbose_name="date de création",
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        auto_now=True, verbose_name="dernière modification"
                    ),
                ),
                (
                    "description",
                    models.TextField(blank=True, verbose_name="description"),
                ),
                (
                    "start_time",
                    agir.events.models.CustomDateTimeField(
                        blank=True, null=True, verbose_name="date et heure de début"
                    ),
                ),
                (
                    "end_time",
                    agir.events.models.CustomDateTimeField(
                        blank=True, null=True, verbose_name="date et heure de fin"
                    ),
                ),
                (
                    "person",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="person_qualifications",
                        related_query_name="person_qualification",
                        to="people.person",
                        verbose_name="personne",
                    ),
                ),
                (
                    "qualification",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="person_qualifications",
                        related_query_name="person_qualification",
                        to="people.qualification",
                        verbose_name="type de statut",
                    ),
                ),
            ],
            options={
                "verbose_name": "statut d'une personne",
                "verbose_name_plural": "statuts",
            },
        ),
    ]
