Type the relationships of City

This commit is contained in:
Alexander Hess 2026-12-01 11:13:03 +01:00
commit 8f5d11db7f
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -64,9 +64,18 @@ class City(meta.Base):
)
# Relationships
addresses = orm.relationship("Address", back_populates="city")
grids = orm.relationship("Grid", back_populates="city")
replays = orm.relationship("ReplaySimulation", back_populates="city")
addresses: orm.Mapped[list[db.Address]] = orm.relationship(
"Address",
back_populates="city",
)
grids: orm.Mapped[list["db.Grid"]] = orm.relationship(
"Grid",
back_populates="city",
)
replays: orm.Mapped[list["db.ReplaySimulation"]] = orm.relationship(
"ReplaySimulation",
back_populates="city",
)
# We do not implement a `.__init__()` method and use SQLAlchemy's default.
# The uninitialized attribute `._map` is computed on the fly. note:d334120ei