mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Tweak queryset for Service views to prefetch related IPs with unrestricted()
This commit is contained in:
@@ -809,7 +809,9 @@ class ServiceListView(ObjectListView):
|
|||||||
|
|
||||||
|
|
||||||
class ServiceView(ObjectView):
|
class ServiceView(ObjectView):
|
||||||
queryset = Service.objects.all()
|
queryset = Service.objects.prefetch_related(
|
||||||
|
Prefetch('ipaddresses', IPAddress.objects.unrestricted())
|
||||||
|
)
|
||||||
|
|
||||||
def get(self, request, pk):
|
def get(self, request, pk):
|
||||||
|
|
||||||
@@ -821,7 +823,9 @@ class ServiceView(ObjectView):
|
|||||||
|
|
||||||
|
|
||||||
class ServiceEditView(ObjectEditView):
|
class ServiceEditView(ObjectEditView):
|
||||||
queryset = Service.objects.all()
|
queryset = Service.objects.prefetch_related(
|
||||||
|
Prefetch('ipaddresses', IPAddress.objects.unrestricted())
|
||||||
|
)
|
||||||
model_form = forms.ServiceForm
|
model_form = forms.ServiceForm
|
||||||
template_name = 'ipam/service_edit.html'
|
template_name = 'ipam/service_edit.html'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user