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

17
back/config/model.py Normal file
View File

@@ -0,0 +1,17 @@
from core.config_factory import ModelConfig
from core.database import Base
from core.typing import Model
def create_model(module_name: str) -> Model:
"""
Creates SQLAlchemy model.
Returns created SQLAlchemy model.
:param module_name: The name of the module.
"""
config = ModelConfig(module_name)
return type(config.module.get_name("model"), (Base,), config.get_model_attrs())