You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import datetime as dt
|
|
import decimal
|
|
|
|
def alchemyencoder(obj):
|
|
"""JSON encoder function for SQLAlchemy special classes."""
|
|
if isinstance(obj, dt.datetime):
|
|
return obj.isoformat()
|
|
elif isinstance(obj, decimal.Decimal):
|
|
return float(obj) |