Merge pull request #10760 from jumpserver/pr@dev@perf_assets_domain

perf: 接口 /api/v1/assets/domains/ sql优化
pull/10770/head
老广 2023-06-19 10:25:20 +08:00 committed by GitHub
commit db12bc07e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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