Django のpkをuuid に変えたところ、
ERROR : Object of type 'UUID' is not JSON serializable
下記で解消。
vi models.py
#
# Fixed for the following error by takahab
# ERROR: Object of type 'UUID' is not JSON serializable
#
#--------------------ここから-------------------------------
from json import JSONEncoder
from uuid import UUID
JSONEncoder_olddefault = JSONEncoder.default
def JSONEncoder_newdefault(self, o):
if isinstance(o, UUID): return str(o)
return JSONEncoder_olddefault(self, o)
JSONEncoder.default = JSONEncoder_newdefault
#-----------------ここまで----------------------------------
登録:
投稿 (Atom)
シャットダウン時の後処理 (shutdown)
# vi /etc/systemd/system/drop.service [Unit] Description= stop httpgwd DefaultDependencies=no Before=shutdown.target RefuseManualStart=true ...
-
【snmp/snmptrap】 # yum -y install net-snmp # yum -y install net-snmp-utils # yum -y install snmptt # yum install perl-Sys-Syslog # fi...
-
history_uint.ibdが肥大化して52Gになった。 -rw-r-----. 1 mysql mysql 52495908864 6月 14 09:20 history_uint.ibd -rw-r-----. 1 mysql mysql 7977566208 ...
-
# mount /dev/nvme0n1p3 /mnt/m2 mount: /mnt/m2: 未知のファイルシステムタイプ 'LVM2_member' です. # fdisk -l /dev/nvme0n1 ディスク /dev/nvme0n1: 953....