fix: db revamp, add relations, annotate the db
also allows for request retrieval, and adds decorator for authed access
This commit is contained in:
@@ -2,8 +2,9 @@ from git import Repo # hash ostatniego commitu
|
||||
import os
|
||||
import time
|
||||
import toml
|
||||
import lewy_db
|
||||
|
||||
global config, randomly_generated_passcode
|
||||
global db, config, randomly_generated_passcode
|
||||
|
||||
class colors:
|
||||
HEADER = '\033[95m'
|
||||
@@ -81,6 +82,14 @@ def getConfig(configfile):
|
||||
else:
|
||||
return toml.load(configfile)
|
||||
|
||||
def setupDb(app, config):
|
||||
global db
|
||||
db = lewy_db.initDB(app, config)
|
||||
return db
|
||||
|
||||
def getDb():
|
||||
return db
|
||||
|
||||
def setConfig(configfile):
|
||||
global config
|
||||
config = getConfig(configfile)
|
||||
|
||||
Reference in New Issue
Block a user