fix: get_alldata_with_batch_and_store时保存json数据采用DjangoJSONEncoder以处理decimal
This commit is contained in:
parent
04daccb733
commit
b5514afa2b
|
@ -6,6 +6,8 @@ from apps.qm.models import FtestWork
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from server.conf import BASE_PROJECT_CODE
|
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):
|
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
|
"last_time": last_time
|
||||||
})
|
})
|
||||||
bobj.last_time = last_time
|
bobj.last_time = last_time
|
||||||
bobj.data = data
|
bobj.data = json.loads(json.dumps(data, cls=DjangoJSONEncoder))
|
||||||
bobj.save()
|
bobj.save()
|
||||||
|
|
||||||
def get_alldata_with_batch_gx(batch: str):
|
def get_alldata_with_batch_gx(batch: str):
|
||||||
|
|
Loading…
Reference in New Issue