mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 16:06:43 -06:00
13757 do prefetch to work around Django issue with vars in init (DeviceType)
This commit is contained in:
parent
6939bf8aed
commit
382a592aaa
@ -467,7 +467,11 @@ class TagBulkDeleteView(generic.BulkDeleteView):
|
||||
#
|
||||
|
||||
class ConfigContextListView(generic.ObjectListView):
|
||||
queryset = ConfigContext.objects.all()
|
||||
queryset = ConfigContext.objects.all().prefetch_related(
|
||||
'regions', 'site_groups', 'sites', 'locations', 'device_types',
|
||||
'roles', 'platforms', 'cluster_types', 'cluster_groups', 'clusters',
|
||||
'tenant_groups', 'tenants', 'tags',
|
||||
)
|
||||
filterset = filtersets.ConfigContextFilterSet
|
||||
filterset_form = forms.ConfigContextFilterForm
|
||||
table = tables.ConfigContextTable
|
||||
@ -515,12 +519,20 @@ class ConfigContextView(generic.ObjectView):
|
||||
|
||||
@register_model_view(ConfigContext, 'edit')
|
||||
class ConfigContextEditView(generic.ObjectEditView):
|
||||
queryset = ConfigContext.objects.all()
|
||||
queryset = ConfigContext.objects.all().prefetch_related(
|
||||
'regions', 'site_groups', 'sites', 'locations', 'device_types',
|
||||
'roles', 'platforms', 'cluster_types', 'cluster_groups', 'clusters',
|
||||
'tenant_groups', 'tenants', 'tags',
|
||||
)
|
||||
form = forms.ConfigContextForm
|
||||
|
||||
|
||||
class ConfigContextBulkEditView(generic.BulkEditView):
|
||||
queryset = ConfigContext.objects.all()
|
||||
queryset = ConfigContext.objects.all().prefetch_related(
|
||||
'regions', 'site_groups', 'sites', 'locations', 'device_types',
|
||||
'roles', 'platforms', 'cluster_types', 'cluster_groups', 'clusters',
|
||||
'tenant_groups', 'tenants', 'tags',
|
||||
)
|
||||
filterset = filtersets.ConfigContextFilterSet
|
||||
table = tables.ConfigContextTable
|
||||
form = forms.ConfigContextBulkEditForm
|
||||
|
Loading…
Reference in New Issue
Block a user