Commit e59ba7ff authored by fangzhipeng's avatar fangzhipeng

修复json 序列化问题

parent 16116bb7
......@@ -9,7 +9,7 @@ from daylife.dao.sqlengin import AlchemyEncoder
class MyJSONEncoder(json.JSONEncoder):
def default(self, obj):
if obj.__dict__:
if hasattr(obj, '__dict__'):
return obj.__dict__
elif isinstance(obj, (datetime.datetime,)):
return int(time.mktime(obj.timetuple()) * 1000)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment