mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Change VLANTranslationPolicy to a PrimaryModel and make name unique
This commit is contained in:
parent
3af686f7f1
commit
bbe684d37a
@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 5.0.9 on 2024-10-08 17:12
|
# Generated by Django 5.0.9 on 2024-10-09 15:20
|
||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 5.0.9 on 2024-10-08 17:12
|
# Generated by Django 5.0.9 on 2024-10-09 15:20
|
||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import taggit.managers
|
import taggit.managers
|
||||||
@ -21,8 +21,8 @@ class Migration(migrations.Migration):
|
|||||||
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
||||||
('last_updated', models.DateTimeField(auto_now=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)),
|
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
||||||
('slug', models.SlugField(max_length=100, unique=True)),
|
('comments', models.TextField(blank=True)),
|
||||||
('name', models.CharField(max_length=100)),
|
('name', models.CharField(max_length=100, unique=True)),
|
||||||
('description', models.CharField(blank=True, max_length=200)),
|
('description', models.CharField(blank=True, max_length=200)),
|
||||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||||
],
|
],
|
||||||
@ -45,6 +45,7 @@ class Migration(migrations.Migration):
|
|||||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
|
'verbose_name': 'VLAN translation rule',
|
||||||
'ordering': ('policy', 'local_vid', 'remote_vid'),
|
'ordering': ('policy', 'local_vid', 'remote_vid'),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -278,10 +278,11 @@ class VLAN(PrimaryModel):
|
|||||||
return self.l2vpn_terminations.first()
|
return self.l2vpn_terminations.first()
|
||||||
|
|
||||||
|
|
||||||
class VLANTranslationPolicy(OrganizationalModel):
|
class VLANTranslationPolicy(PrimaryModel):
|
||||||
name = models.CharField(
|
name = models.CharField(
|
||||||
verbose_name=_('name'),
|
verbose_name=_('name'),
|
||||||
max_length=100,
|
max_length=100,
|
||||||
|
unique=True,
|
||||||
)
|
)
|
||||||
description = models.CharField(
|
description = models.CharField(
|
||||||
verbose_name=_('description'),
|
verbose_name=_('description'),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 5.0.9 on 2024-10-08 17:12
|
# Generated by Django 5.0.9 on 2024-10-09 15:20
|
||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
Loading…
Reference in New Issue
Block a user