From a0563b8575e8f183938addca565422c5c271aab6 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 10 Jan 2025 11:04:44 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20asset=20get=20quer?= =?UTF-8?q?yset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/api/asset/asset.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/assets/api/asset/asset.py b/apps/assets/api/asset/asset.py index bfac3ec1c..fe6dca890 100644 --- a/apps/assets/api/asset/asset.py +++ b/apps/assets/api/asset/asset.py @@ -116,7 +116,8 @@ class AssetViewSet(SuggestionMixin, OrgBulkModelViewSet): def get_queryset(self): queryset = super().get_queryset() - if queryset.model is not Asset: + if queryset.model.__name__ != 'Asset': + print("get query prefetch") queryset = queryset.select_related('asset_ptr') return queryset