# Generated by Django 5.2.11 on 2026-03-18 02:50

import django.db.models.deletion
import netbox.models.deletion
import taggit.managers
import utilities.json
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("dcim", "0226_modulebay_rebuild_tree"),
        ("extras", "0134_owner"),
        ("netbox_fms", "0020_spliceplanentry_is_express"),
    ]

    operations = [
        migrations.CreateModel(
            name="SlackLoop",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
                ("created", models.DateTimeField(auto_now_add=True, null=True)),
                ("last_updated", models.DateTimeField(auto_now=True, null=True)),
                (
                    "custom_field_data",
                    models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
                ),
                ("start_mark", models.DecimalField(decimal_places=2, max_digits=10)),
                ("end_mark", models.DecimalField(decimal_places=2, max_digits=10)),
                ("length_unit", models.CharField(max_length=10)),
                ("storage_method", models.CharField(blank=True, max_length=50)),
                ("notes", models.TextField(blank=True)),
                (
                    "fiber_cable",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="slack_loops",
                        to="netbox_fms.fibercable",
                    ),
                ),
                (
                    "location",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="dcim.location",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name="+", to="dcim.site"),
                ),
                ("tags", taggit.managers.TaggableManager(through="extras.TaggedItem", to="extras.Tag")),
            ],
            options={
                "verbose_name": "slack loop",
                "verbose_name_plural": "slack loops",
                "ordering": ("fiber_cable", "start_mark"),
                "unique_together": {("fiber_cable", "start_mark", "end_mark")},
            },
            bases=(netbox.models.deletion.DeleteMixin, models.Model),
        ),
    ]
