Make mypy as strict as practical #13
1 changed files with 12 additions and 3 deletions
Type the relationships of Pixel
commit
699e7f0443
|
|
@ -63,9 +63,18 @@ class Pixel(meta.Base):
|
|||
)
|
||||
|
||||
# Relationships
|
||||
grid = orm.relationship("Grid", back_populates="pixels")
|
||||
addresses = orm.relationship("AddressPixelAssociation", back_populates="pixel")
|
||||
forecasts = orm.relationship("Forecast", back_populates="pixel")
|
||||
grid: orm.Mapped[db.Grid] = orm.relationship(
|
||||
"Grid",
|
||||
back_populates="pixels",
|
||||
)
|
||||
addresses: orm.Mapped[list[db.AddressPixelAssociation]] = orm.relationship(
|
||||
"AddressPixelAssociation",
|
||||
back_populates="pixel",
|
||||
)
|
||||
forecasts: orm.Mapped[list[db.Forecast]] = orm.relationship(
|
||||
"Forecast",
|
||||
back_populates="pixel",
|
||||
)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
"""Non-literal text representation."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue