From 8f5d11db7f4abccb06b47fe6e0cc3ceaa2a87db7 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 1 Dec 2026 11:13:03 +0100 Subject: [PATCH] Type the relationships of `City` --- src/velofy/db/cities.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/velofy/db/cities.py b/src/velofy/db/cities.py index 2c2bcb7..e232953 100644 --- a/src/velofy/db/cities.py +++ b/src/velofy/db/cities.py @@ -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