mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-24 14:51:05 +01:00
- extensions are now blueprints: keep views, templastes and statics in the same folder - increase app security using `flask-talisman` - whenever possible use {{ url_for }} for links between pages - remove references to non-existing JavaScript code - add missing favicon.ico
13 lines
270 B
Python
13 lines
270 B
Python
import json
|
|
import sqlite3
|
|
|
|
|
|
class MegaEncoder(json.JSONEncoder):
|
|
def default(self, obj):
|
|
if isinstance(obj, sqlite3.Row):
|
|
return {k: obj[k] for k in obj.keys()}
|
|
return obj
|
|
|
|
|
|
def megajson(obj):
|
|
return json.dumps(obj, cls=MegaEncoder)
|