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 # Relationships
addresses = orm.relationship("Address", back_populates="city") addresses: orm.Mapped[list[db.Address]] = orm.relationship(
grids = orm.relationship("Grid", back_populates="city") "Address",
replays = orm.relationship("ReplaySimulation", back_populates="city") 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. # We do not implement a `.__init__()` method and use SQLAlchemy's default.
# The uninitialized attribute `._map` is computed on the fly. note:d334120ei # The uninitialized attribute `._map` is computed on the fly. note:d334120ei