| 87 | |
| 88 | |
| 89 | class Report(Base): |
| 90 | __tablename__ = "weather_reports" |
| 91 | |
| 92 | id: Mapped[int] = mapped_column(primary_key=True) |
| 93 | location_id: Mapped[int] = mapped_column( |
| 94 | ForeignKey("weather_locations.id") |
| 95 | ) |
| 96 | temperature: Mapped[float] |
| 97 | report_time: Mapped[datetime.datetime] = mapped_column( |
| 98 | default=datetime.datetime.now |
| 99 | ) |
| 100 | |
| 101 | location: Mapped[WeatherLocation] = relationship(back_populates="reports") |
| 102 | |
| 103 | def __init__(self, temperature: float): |
| 104 | self.temperature = temperature |
| 105 | |
| 106 | |
| 107 | # define sharding functions. |
no test coverage detected