mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 19:08:38 -06:00
18296 add tenant to vlan groups
This commit is contained in:
parent
697610db94
commit
883113fa7d
26
netbox/ipam/migrations/0077_vlangroup_tenant.py
Normal file
26
netbox/ipam/migrations/0077_vlangroup_tenant.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Generated by Django 5.1.3 on 2025-02-20 17:49
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('ipam', '0076_natural_ordering'),
|
||||||
|
('tenancy', '0017_natural_ordering'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='vlangroup',
|
||||||
|
name='tenant',
|
||||||
|
field=models.ForeignKey(
|
||||||
|
blank=True,
|
||||||
|
null=True,
|
||||||
|
on_delete=django.db.models.deletion.PROTECT,
|
||||||
|
related_name='vlan_groups',
|
||||||
|
to='tenancy.tenant',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
@ -65,6 +65,13 @@ class VLANGroup(OrganizationalModel):
|
|||||||
_total_vlan_ids = models.PositiveBigIntegerField(
|
_total_vlan_ids = models.PositiveBigIntegerField(
|
||||||
default=VLAN_VID_MAX - VLAN_VID_MIN + 1
|
default=VLAN_VID_MAX - VLAN_VID_MIN + 1
|
||||||
)
|
)
|
||||||
|
tenant = models.ForeignKey(
|
||||||
|
to='tenancy.Tenant',
|
||||||
|
on_delete=models.PROTECT,
|
||||||
|
related_name='vlan_groups',
|
||||||
|
blank=True,
|
||||||
|
null=True
|
||||||
|
)
|
||||||
|
|
||||||
objects = VLANGroupQuerySet.as_manager()
|
objects = VLANGroupQuerySet.as_manager()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user