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
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue