mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes #4926: Fix ordering of VM interfaces in REST API endpoint
This commit is contained in:
parent
712e850951
commit
76c2fd3414
@ -16,6 +16,7 @@
|
||||
* [#4894](https://github.com/netbox-community/netbox/issues/4894) - Fix display of device/VM counts on platforms list
|
||||
* [#4895](https://github.com/netbox-community/netbox/issues/4895) - Force UTF-8 encoding when embedding model documentation
|
||||
* [#4910](https://github.com/netbox-community/netbox/issues/4910) - Unpin redis dependency to fix exception in RQ worker
|
||||
* [#4926](https://github.com/netbox-community/netbox/issues/4926) - Fix ordering of VM interfaces in REST API endpoint
|
||||
* [#4927](https://github.com/netbox-community/netbox/issues/4927) - Fix validation error when updating an existing secret
|
||||
* [#4929](https://github.com/netbox-community/netbox/issues/4929) - Correct log message when creating a new object
|
||||
|
||||
|
@ -3,6 +3,7 @@ from django.db.models import Count
|
||||
from dcim.models import Device, Interface
|
||||
from extras.api.views import CustomFieldModelViewSet
|
||||
from utilities.api import ModelViewSet
|
||||
from utilities.query_functions import CollateAsChar
|
||||
from utilities.utils import get_subquery
|
||||
from virtualization import filters
|
||||
from virtualization.models import Cluster, ClusterGroup, ClusterType, VirtualMachine
|
||||
@ -74,7 +75,7 @@ class VirtualMachineViewSet(CustomFieldModelViewSet):
|
||||
class InterfaceViewSet(ModelViewSet):
|
||||
queryset = Interface.objects.filter(
|
||||
virtual_machine__isnull=False
|
||||
).prefetch_related(
|
||||
).order_by('virtual_machine', CollateAsChar('_name')).prefetch_related(
|
||||
'virtual_machine', 'tags'
|
||||
)
|
||||
serializer_class = serializers.InterfaceSerializer
|
||||
|
Loading…
Reference in New Issue
Block a user