koa_middleware.database.orm_base

Classes

CalibrationORM(**kwargs)

A lightweight mixin base class for SQLAlchemy ORM objects representing calibration data.

class koa_middleware.database.orm_base.CalibrationORM(**kwargs: Any)[source]

Bases: DeclarativeBase

A lightweight mixin base class for SQLAlchemy ORM objects representing calibration data.

This class provides common utility methods that can be inherited by SQLAlchemy declarative base classes to facilitate conversion to dictionary format and a readable string representation.

Classes inheriting from CalibrationORM are expected to be SQLAlchemy models with defined table columns.

metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

See also

orm_declarative_metadata

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

to_dict() dict[source]

Converts the ORM object’s column data into a dictionary.

The keys of the dictionary will be the column names, and the values will be the corresponding attribute values of the ORM object.

Returns:

dict – A dictionary representation of the ORM object’s data.