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

Allow unassigning VRF and tenants when editing objects in bulk

This commit is contained in:
Jeremy Stretch
2016-07-28 15:59:49 -04:00
parent 6b41794e12
commit 397943b222
7 changed files with 70 additions and 41 deletions

View File

@ -4,6 +4,7 @@ from django import forms
from django.db.models import Count
from dcim.models import Site, Device, Interface
from tenancy.forms import bulkedit_tenant_choices
from tenancy.models import Tenant
from utilities.forms import BootstrapMixin, APISelect, Livesearch, CSVDataField, BulkImportForm, SlugField
@ -17,6 +18,9 @@ FORM_VLAN_STATUS_CHOICES = (('', '---------'),) + VLAN_STATUS_CHOICES
def bulkedit_vrf_choices():
"""
Include an option to assign the object to the global table.
"""
choices = [
(None, '---------'),
(0, 'Global'),
@ -25,15 +29,6 @@ def bulkedit_vrf_choices():
return choices
def bulkedit_tenant_choices():
choices = [
(None, '---------'),
(0, 'None'),
]
choices += [(t.pk, t.name) for t in Tenant.objects.all()]
return choices
#
# VRFs
#