From 4524822245ecdac9a749ca0ea79d078e3f3d44fa Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Tue, 18 Nov 2025 11:19:38 +0800 Subject: [PATCH] fix: Solve this version of Mysql doesn't yet support 'LIMIT & IN/ALL/ANY/S0ME subquery' error --- apps/assets/models/my_asset.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/assets/models/my_asset.py b/apps/assets/models/my_asset.py index 605962972..cc05af7cf 100644 --- a/apps/assets/models/my_asset.py +++ b/apps/assets/models/my_asset.py @@ -28,7 +28,8 @@ class MyAsset(JMSBaseModel): @staticmethod def set_asset_custom_value(assets, user): - my_assets = MyAsset.objects.filter(asset__in=assets, user=user).all() + asset_ids = [asset.id for asset in assets] + my_assets = MyAsset.objects.filter(asset_id__in=asset_ids, user=user).all() customs = {my_asset.asset.id: my_asset.custom_to_dict() for my_asset in my_assets} for asset in assets: custom = customs.get(asset.id)