# Generated by Django 3.2.5 on 2021-07-18 20:27

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


class Migration(migrations.Migration):
    dependencies = [
        ("sinp_nomenclatures", "0001_initial"),
        ("sinp_organisms", "0001_initial"),
    ]

    operations = [
        migrations.AlterField(
            model_name="organism",
            name="action_scope",
            field=models.ForeignKey(
                help_text="Périmètre d'action de l'organisme",
                limit_choices_to={"type__mnemonic": "action_scope"},
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="organism_action_scope",
                to="sinp_nomenclatures.nomenclature",
                verbose_name="Périmètre d'action",
            ),
        ),
        migrations.AlterField(
            model_name="organism",
            name="geographic_area",
            field=models.ForeignKey(
                blank=True,
                help_text="Zone d'action géographique de l'organisme",
                limit_choices_to={"type__mnemonic": "geographic_area"},
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="organism_geographic_area",
                to="sinp_nomenclatures.nomenclature",
                verbose_name="Zone géographique",
            ),
        ),
        migrations.AlterField(
            model_name="organism",
            name="geographic_area_details",
            field=models.CharField(
                blank=True,
                help_text="Information précisant la zone géographique d'action.",
                max_length=500,
                null=True,
                verbose_name="Détails sur la zone géographique",
            ),
        ),
        migrations.AlterField(
            model_name="organism",
            name="phone_number",
            field=models.CharField(
                blank=True,
                max_length=17,
                null=True,
                validators=[
                    django.core.validators.RegexValidator(
                        message="Les numéros de téléphones doivent être renseignés avec le format :'+999999999'. jusqu'à 15 chiffres sont autorisés",
                        regex="^\\+?1?\\d{9,15}$",
                    )
                ],
                verbose_name="Numéro de téléphone",
            ),
        ),
        migrations.AlterField(
            model_name="organism",
            name="status",
            field=models.ForeignKey(
                help_text="Permet d'indiquer si l'organisme est public ou privé",
                limit_choices_to={"type__mnemonic": "organism_status"},
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="organism_status",
                to="sinp_nomenclatures.nomenclature",
                verbose_name="Statut",
            ),
        ),
        migrations.AlterField(
            model_name="organism",
            name="type",
            field=models.ForeignKey(
                limit_choices_to={"type__mnemonic": "organism_type"},
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name="organism_type",
                to="sinp_nomenclatures.nomenclature",
                verbose_name="Type d'organisme",
            ),
        ),
        migrations.AlterField(
            model_name="organismmember",
            name="member_level",
            field=models.ForeignKey(
                limit_choices_to={"type__mnemonic": "member_level"},
                on_delete=django.db.models.deletion.CASCADE,
                related_name="member_level",
                to="sinp_nomenclatures.nomenclature",
                verbose_name="Niveau du membre",
            ),
        ),
    ]
