Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions netbox_floorplan/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def get(self, request):
self.queryset = Rack.objects.all().filter(~Q(id__in=fp_instance.mapped_racks)).filter(
site=fp_instance.site.id).order_by("name")
else:
locations = Location.objects.get(pk=fp_instance.location.id).get_descendants(include_self=True)
self.queryset = Rack.objects.all().filter(~Q(id__in=fp_instance.mapped_racks)).filter(
location=fp_instance.location.id).order_by("name")
location__in=locations).order_by("name")
return super().get(request)


Expand All @@ -129,6 +130,7 @@ def get(self, request):
self.queryset = Device.objects.all().filter(~Q(id__in=fp_instance.mapped_devices)).filter(
site=fp_instance.site.id).order_by("name")
else:
locations = Location.objects.get(pk=fp_instance.location.id).get_descendants(include_self=True)
self.queryset = Device.objects.all().filter(~Q(id__in=fp_instance.mapped_devices)).filter(
location=fp_instance.location.id).order_by("name")
location__in=locations).order_by("name")
return super().get(request)