lnbits-legend/lnbits/helpers.py
2020-02-05 11:47:17 +00:00

17 lines
316 B
Python

import json
import sqlite3
class MegaEncoder(json.JSONEncoder):
def default(self, o):
if type(o) == sqlite3.Row:
val = {}
for k in o.keys():
val[k] = o[k]
return val
return obj
def megajson(obj):
return json.dumps(obj, cls=MegaEncoder)