mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Rename Interface to VMInterface
This commit is contained in:
@@ -10,7 +10,7 @@ from ipam.models import VLAN
|
||||
from tenancy.api.nested_serializers import NestedTenantSerializer
|
||||
from utilities.api import ChoiceField, SerializedPKRelatedField, ValidatedModelSerializer
|
||||
from virtualization.choices import *
|
||||
from virtualization.models import Cluster, ClusterGroup, ClusterType, Interface, VirtualMachine
|
||||
from virtualization.models import Cluster, ClusterGroup, ClusterType, VirtualMachine, VMInterface
|
||||
from .nested_serializers import *
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class InterfaceSerializer(TaggedObjectSerializer, ValidatedModelSerializer):
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Interface
|
||||
model = VMInterface
|
||||
fields = [
|
||||
'id', 'virtual_machine', 'name', 'enabled', 'mtu', 'mac_address', 'description', 'mode', 'untagged_vlan',
|
||||
'tagged_vlans', 'tags',
|
||||
|
||||
@@ -5,7 +5,7 @@ from extras.api.views import CustomFieldModelViewSet
|
||||
from utilities.api import ModelViewSet
|
||||
from utilities.utils import get_subquery
|
||||
from virtualization import filters
|
||||
from virtualization.models import Cluster, ClusterGroup, ClusterType, Interface, VirtualMachine
|
||||
from virtualization.models import Cluster, ClusterGroup, ClusterType, VirtualMachine, VMInterface
|
||||
from . import serializers
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class VirtualMachineViewSet(CustomFieldModelViewSet):
|
||||
|
||||
|
||||
class InterfaceViewSet(ModelViewSet):
|
||||
queryset = Interface.objects.filter(
|
||||
queryset = VMInterface.objects.filter(
|
||||
virtual_machine__isnull=False
|
||||
).prefetch_related(
|
||||
'virtual_machine', 'tags'
|
||||
|
||||
Reference in New Issue
Block a user