epicpost/funding/bin/utils.py

8 lines
194 B
Python
Raw Permalink Normal View History

2022-08-07 12:15:02 +00:00
from datetime import datetime, date
def json_encoder(obj):
if isinstance(obj, (datetime, date)):
return obj.isoformat()
raise TypeError("Type %s not serializable" % type(obj))