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

26 lines
1.0 KiB
Python
Raw Normal View History

from typing import Optional
from sqlalchemy import ForeignKey, Identity
2024-10-14 16:57:57 +04:00
from sqlalchemy.orm import Mapped, mapped_column
from db.models.base import Base
2024-10-14 16:57:57 +04:00
class ExperimentParameters(Base):
__tablename__ = 'experiment_parameters'
2024-10-14 16:57:57 +04:00
id: Mapped[int] = mapped_column(Identity(start=1100, cycle=True),
primary_key=True)
2024-10-14 16:57:57 +04:00
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)
2024-10-25 02:15:24 +04:00
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)
2024-10-14 16:57:57 +04:00
def __repr__(self):
return f"<ExperimentParameters>"