mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 02:06:42 -06:00
Improve performance when fetching objects for bulk edit
This commit is contained in:
parent
b725a9bcea
commit
b3a14e9a7b
@ -774,9 +774,7 @@ class BulkEditView(GetReturnURLMixin, ObjectPermissionRequiredMixin, View):
|
|||||||
|
|
||||||
# If we are editing *all* objects in the queryset, replace the PK list with all matched objects.
|
# If we are editing *all* objects in the queryset, replace the PK list with all matched objects.
|
||||||
if request.POST.get('_all') and self.filterset is not None:
|
if request.POST.get('_all') and self.filterset is not None:
|
||||||
pk_list = [
|
pk_list = self.filterset(request.GET, self.queryset.values_list('pk', flat=True)).qs
|
||||||
obj.pk for obj in self.filterset(request.GET, self.queryset.only('pk')).qs
|
|
||||||
]
|
|
||||||
else:
|
else:
|
||||||
pk_list = request.POST.getlist('pk')
|
pk_list = request.POST.getlist('pk')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user