refs #0 The root commit.
This commit is contained in:
19
back/config/create_schema.py
Normal file
19
back/config/create_schema.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from core.config_factory import CreateSchemaConfig
|
||||
from core.typing import CreateSchema
|
||||
from pydantic import create_model
|
||||
|
||||
|
||||
def create_create_schema(module_name: str) -> CreateSchema:
|
||||
"""
|
||||
Creates pydantic module for item creating.
|
||||
|
||||
Returns pydantic model.
|
||||
|
||||
:param module_name: The name of the module.
|
||||
"""
|
||||
|
||||
config = CreateSchemaConfig(module_name)
|
||||
|
||||
return create_model(
|
||||
config.module.get_name("create_schema"), **config.get_create_field_defs()
|
||||
)
|
||||
Reference in New Issue
Block a user