perf: 接口 /api/v1/assets/domains/ sql优化

pull/10760/head
fangfang.dong 2023-06-18 20:24:14 +08:00
parent 09f7ddd28a
commit a8ef405939
1 changed files with 2 additions and 0 deletions

View File

@ -26,6 +26,8 @@ class DomainViewSet(OrgBulkModelViewSet):
return serializers.DomainWithGatewaySerializer
return serializers.DomainSerializer
def get_queryset(self):
return super().get_queryset().prefetch_related('assets')
class GatewayViewSet(HostViewSet):
perm_model = Gateway