2024-10-14 22:02:08 +04:00
|
|
|
from typing import Optional
|
|
|
|
|
2024-10-21 13:25:59 +04:00
|
|
|
from sqlalchemy import ForeignKey, Identity
|
|
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
2024-10-14 22:02:08 +04:00
|
|
|
|
2024-10-18 16:42:39 +04:00
|
|
|
from db.models.base import Base
|
2024-10-21 13:25:59 +04:00
|
|
|
|
2024-10-14 19:49:54 +04:00
|
|
|
|
|
|
|
class RecyclingParameters(Base):
|
2024-10-14 22:02:08 +04:00
|
|
|
__tablename__ = 'recycling_parameters'
|
2024-10-14 19:49:54 +04:00
|
|
|
|
2024-11-20 00:11:58 +04:00
|
|
|
id: Mapped[int] = mapped_column(Identity(start=1000, cycle=True),
|
2024-10-21 13:25:59 +04:00
|
|
|
primary_key=True)
|
|
|
|
|
2024-10-14 22:02:08 +04:00
|
|
|
load_id: Mapped[Optional[int]] = mapped_column(ForeignKey('load_parameters.id', ondelete='SET NULL'))
|
2024-10-14 19:49:54 +04:00
|
|
|
recycling_level: Mapped[int]
|
|
|
|
co2: Mapped[float]
|
|
|
|
n2: Mapped[float]
|
|
|
|
h2o: Mapped[float]
|
|
|
|
o2: Mapped[float]
|
|
|
|
|
|
|
|
def __repr__(self):
|
2024-10-21 13:25:59 +04:00
|
|
|
return f"<RecyclingParameters>"
|