koa_middleware.database.orm_base
Classes
|
A lightweight mixin base class for SQLAlchemy ORM objects representing calibration data. |
- class koa_middleware.database.orm_base.CalibrationORM(**kwargs: Any)[source]
Bases:
DeclarativeBaseA 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.MetaDatacollection that will be used for new_schema.Tableobjects.See also
orm_declarative_metadata
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>
Refers to the
_orm.registryin use where new_orm.Mapperobjects 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.