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)
chrome 日本語入力できない。GTK4互換問題
vi /usr/share/applications/google-chrome.desktop Exec=/usr/bin/google-chrome-stable --gtk-version=3 %U Exec=/usr/bin/google-chrome-stable ...
-
# mount /dev/nvme0n1p3 /mnt/m2 mount: /mnt/m2: 未知のファイルシステムタイプ 'LVM2_member' です. # fdisk -l /dev/nvme0n1 ディスク /dev/nvme0n1: 953....
-
■Rocky Linux8 ORACLE RPM インストール # curl -o oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/ap...
-
【snmp/snmptrap】 # yum -y install net-snmp # yum -y install net-snmp-utils # yum -y install snmptt # yum install perl-Sys-Syslog # fi...