mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 18:11:30 +01:00
17 lines
310 B
Python
17 lines
310 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 o
|
|
|
|
|
|
def megajson(o):
|
|
return json.dumps(o, cls=MegaEncoder)
|