From a8f9676ed0f0fc8fbfdc36e96d32934996768208 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 3 Apr 2025 08:34:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20get=5Falldata=5Fwith=5Fbatch=5Fand=5Fsto?= =?UTF-8?q?re=E6=97=B6=E4=BF=9D=E5=AD=98json=E6=95=B0=E6=8D=AE=E9=87=87?= =?UTF-8?q?=E7=94=A8DjangoJSONEncoder=E4=BB=A5=E5=A4=84=E7=90=86decimal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services_2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wpm/services_2.py b/apps/wpm/services_2.py index 5911613f..3f767583 100644 --- a/apps/wpm/services_2.py +++ b/apps/wpm/services_2.py @@ -6,6 +6,8 @@ from apps.qm.models import FtestWork from django.utils import timezone from datetime import datetime from server.conf import BASE_PROJECT_CODE +import json +from django.core.serializers.json import DjangoJSONEncoder def get_alldata_with_batch_and_store(batch: str): """ @@ -24,7 +26,7 @@ def get_alldata_with_batch_and_store(batch: str): "last_time": last_time }) bobj.last_time = last_time - bobj.data = data + bobj.data = json.loads(json.dumps(data, cls=DjangoJSONEncoder)) bobj.save() def get_alldata_with_batch_gx(batch: str):