12548 add prefetch_related for l2vpn and vdcs to interface api

This commit is contained in:
Arthur 2023-05-18 10:40:41 -07:00 committed by Jeremy Stretch
parent 2204735e9f
commit 92c49669f9

View File

@ -493,7 +493,8 @@ class PowerOutletViewSet(PathEndpointMixin, NetBoxModelViewSet):
class InterfaceViewSet(PathEndpointMixin, NetBoxModelViewSet):
queryset = Interface.objects.prefetch_related(
'device', 'module__module_bay', 'parent', 'bridge', 'lag', '_path', 'cable__terminations', 'wireless_lans',
'untagged_vlan', 'tagged_vlans', 'vrf', 'ip_addresses', 'fhrp_group_assignments', 'tags'
'untagged_vlan', 'tagged_vlans', 'vrf', 'ip_addresses', 'fhrp_group_assignments', 'tags', 'l2vpn_terminations',
'vdcs',
)
serializer_class = serializers.InterfaceSerializer
filterset_class = filtersets.InterfaceFilterSet