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

perf: 接口 /api/v1/assets/domains/ sql优化
pull/10770/head
老广 1 year ago committed by GitHub
commit db12bc07e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save