refs #0 The root commit.

This commit is contained in:
sbps-test user
2023-09-13 20:37:14 +03:00
commit 10eb607154
66 changed files with 1643 additions and 0 deletions

24
back/core/util.py Normal file
View File

@@ -0,0 +1,24 @@
from config.module import Module
from core.database import SessionLocal
from core.helper import get_file_name, get_parent_directory_name
def update_module_locals(path, _locals):
item = get_file_name(path)
module_name = get_parent_directory_name(path)
module = Module(module_name)
_locals[module.get_name(item)] = module.get_item(item)
def get_session():
session = SessionLocal()
try:
yield session
finally:
session.close()
def get_module(module: str) -> dict:
return Module(module).get_item("create_schema").construct().schema()