1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #6874: Add tenant assignment for locations

This commit is contained in:
jeremystretch
2021-10-07 15:46:21 -04:00
parent 18c3bb673f
commit 5a6190e321
11 changed files with 82 additions and 19 deletions

View File

@@ -7,7 +7,6 @@ from timezone_field import TimeZoneField
from dcim.choices import *
from dcim.constants import *
from django.core.exceptions import ValidationError
from dcim.fields import ASNField
from extras.utils import extras_features
from netbox.models import NestedGroupModel, PrimaryModel
@@ -281,6 +280,13 @@ class Location(NestedGroupModel):
null=True,
db_index=True
)
tenant = models.ForeignKey(
to='tenancy.Tenant',
on_delete=models.PROTECT,
related_name='locations',
blank=True,
null=True
)
description = models.CharField(
max_length=200,
blank=True