ochra.common.base

pydantic model ochra.common.base.data_model.DataModel

Bases: BaseModel

DataModel class that serves as a base for all dataclasses that are to be stored in the database.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field cls: str = None

The class name of the data model.

field collection: str = None

The name of the collection where the data model will be stored.

field id: UUID [Optional]

Unique identifier for the data model instance.

field module_path: str = None

The module path of the data model.

get_base_model()

Get a base model containing the base information of the model instance.

Returns:

A base model containing the base information of the model instance.

Return type:

DataModel

model_post_init(_DataModel__context)

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

_DataModel__context (Any)

Return type:

None