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