mirror of https://github.com/lukechilds/lnbits.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
310 B
16 lines
310 B
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 o
|
|
|
|
|
|
def megajson(o):
|
|
return json.dumps(o, cls=MegaEncoder)
|
|
|