# Generated by Django 5.2.1 on 2025-06-02 18:20

import _socket
import django.core.validators
import django.db.models.deletion
import django_audit_fields.fields.hostname_modification_field
import django_audit_fields.fields.userfield
import django_audit_fields.fields.uuid_auto_field
import django_audit_fields.models.audit_model_mixin
import django_revision.revision_field
from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):
    dependencies = [
        ("edc_reportable", "0002_alter_gradingdata_age_upper_and_more"),
    ]

    operations = [
        migrations.AddField(
            model_name="referencerangecollection",
            name="grade1",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="referencerangecollection",
            name="grade2",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="referencerangecollection",
            name="grade3",
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name="referencerangecollection",
            name="grade4",
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name="gradingdata",
            name="age_phrase",
            field=models.CharField(help_text="calculated in save()", max_length=25, null=True),
        ),
        migrations.AlterField(
            model_name="gradingdata",
            name="gender",
            field=models.CharField(
                max_length=1,
                validators=[django.core.validators.RegexValidator("[MF]{1}")],
            ),
        ),
        migrations.AlterField(
            model_name="gradingdata",
            name="phrase",
            field=models.CharField(
                help_text="calculated by the formula instance",
                max_length=50,
                null=True,
                verbose_name="Value phrase",
            ),
        ),
        migrations.AlterField(
            model_name="normaldata",
            name="age_phrase",
            field=models.CharField(help_text="calculated in save()", max_length=25, null=True),
        ),
        migrations.AlterField(
            model_name="normaldata",
            name="gender",
            field=models.CharField(
                max_length=1,
                validators=[django.core.validators.RegexValidator("[MF]{1}")],
            ),
        ),
        migrations.AlterField(
            model_name="normaldata",
            name="grade",
            field=models.IntegerField(
                null=True,
                validators=[
                    django.core.validators.MinValueValidator(1),
                    django.core.validators.MaxValueValidator(5),
                ],
            ),
        ),
        migrations.AlterField(
            model_name="normaldata",
            name="phrase",
            field=models.CharField(
                help_text="calculated by the formula instance",
                max_length=50,
                null=True,
                verbose_name="Value phrase",
            ),
        ),
        migrations.CreateModel(
            name="GradingException",
            fields=[
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text="System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        blank=True,
                        default=django.utils.timezone.now,
                    ),
                ),
                (
                    "modified",
                    models.DateTimeField(
                        blank=True,
                        default=django.utils.timezone.now,
                    ),
                ),
                (
                    "user_created",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    django_audit_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                        verbose_name="Hostname created",
                    ),
                ),
                (
                    "hostname_modified",
                    django_audit_fields.fields.hostname_modification_field.HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                        verbose_name="Hostname modified",
                    ),
                ),
                (
                    "device_created",
                    models.CharField(blank=True, max_length=10, verbose_name="Device created"),
                ),
                (
                    "device_modified",
                    models.CharField(
                        blank=True, max_length=10, verbose_name="Device modified"
                    ),
                ),
                (
                    "locale_created",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale created",
                    ),
                ),
                (
                    "locale_modified",
                    models.CharField(
                        blank=True,
                        help_text="Auto-updated by Modeladmin",
                        max_length=10,
                        null=True,
                        verbose_name="Locale modified",
                    ),
                ),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("label", models.CharField(max_length=50)),
                ("grade1", models.BooleanField(default=False)),
                ("grade2", models.BooleanField(default=False)),
                ("grade3", models.BooleanField(default=False)),
                ("grade4", models.BooleanField(default=False)),
                (
                    "reference_range_collection",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="edc_reportable.referencerangecollection",
                    ),
                ),
            ],
            options={
                "verbose_name": "Grading Exception",
                "verbose_name_plural": "Grading Exceptions",
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "export",
                    "import",
                ),
                "default_manager_name": "objects",
                "indexes": [
                    models.Index(
                        fields=["modified", "created"],
                        name="edc_reporta_modifie_a16896_idx",
                    ),
                    models.Index(
                        fields=["user_modified", "user_created"],
                        name="edc_reporta_user_mo_8ec7a5_idx",
                    ),
                ],
            },
        ),
    ]
