PIbd-42_SSPR/db/models/experiment_parameters_model.py

26 lines
1.0 KiB
Python

from typing import Optional
from sqlalchemy import ForeignKey, Identity
from sqlalchemy.orm import Mapped, mapped_column
from db.models.base import Base
class ExperimentParameters(Base):
__tablename__ = 'experiment_parameters'
id: Mapped[int] = mapped_column(Identity(start=1100, cycle=True),
primary_key=True)
outer_blades_count: Mapped[int]
outer_blades_length: Mapped[float]
outer_blades_angle: Mapped[float]
middle_blades_count: Mapped[int]
load_id: Mapped[Optional[int]] = mapped_column(ForeignKey('load_parameters.id', ondelete='SET NULL'))
recycling_id: Mapped[Optional[int]] = mapped_column(ForeignKey('recycling_parameters.id', ondelete='SET NULL'))
experiment_hash: Mapped[str] = mapped_column(unique=True)
experiment_category_id: Mapped[Optional[int]] = mapped_column(ForeignKey('experiment_category.id', ondelete='SET NULL'), nullable=True)
oxidizer_temp: Mapped[float] = mapped_column(nullable=True)
def __repr__(self):
return f"<ExperimentParameters>"