Type the relationships of City
This commit is contained in:
parent
de86c2e64d
commit
8f5d11db7f
1 changed files with 12 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue