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

21
back/config/schema.py Normal file
View File

@@ -0,0 +1,21 @@
from core.config_factory import SchemaConfig
from core.typing import Schema
from pydantic import create_model
def create_schema(module_name: str) -> Schema:
"""
Creates pydantic module for item returning.
Returns pydantic model.
:param module_name: The name of the module.
"""
config = SchemaConfig(module_name)
return create_model(
config.module.get_name("schema"),
__config__=config.Config,
**config.get_field_defs(),
)