From a8ef40593916b9ad28540b7ea4cccc1f9bc6154a Mon Sep 17 00:00:00 2001 From: "fangfang.dong" Date: Sun, 18 Jun 2023 20:24:14 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=8E=A5=E5=8F=A3=20/api/v1/assets/dom?= =?UTF-8?q?ains/=20sql=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/api/domain.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/assets/api/domain.py b/apps/assets/api/domain.py index f27f09c90..40d676d78 100644 --- a/apps/assets/api/domain.py +++ b/apps/assets/api/domain.py @@ -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