refactor: use Flask Blueprints to organize extensions
- 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
This commit is contained in:
+6
-9
@@ -3,14 +3,11 @@ 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 default(self, obj):
|
||||
if isinstance(obj, sqlite3.Row):
|
||||
return {k: obj[k] for k in obj.keys()}
|
||||
return obj
|
||||
|
||||
|
||||
def megajson(o):
|
||||
return json.dumps(o, cls=MegaEncoder)
|
||||
def megajson(obj):
|
||||
return json.dumps(obj, cls=MegaEncoder)
|
||||
|
||||
Reference in New Issue
Block a user