Type the relationships of ReplaySimulation
This commit is contained in:
parent
4be6078327
commit
5ad3fb538d
1 changed files with 9 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
|
||||||
|
from velofy import db
|
||||||
from velofy.db import meta
|
from velofy.db import meta
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -50,8 +51,14 @@ class ReplaySimulation(meta.Base):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Relationships
|
# Relationships
|
||||||
city = orm.relationship("City", back_populates="replays")
|
city: orm.Mapped[db.City] = orm.relationship(
|
||||||
orders = orm.relationship("ReplayedOrder", back_populates="simulation")
|
"City",
|
||||||
|
back_populates="replays",
|
||||||
|
)
|
||||||
|
orders: orm.Mapped[list["db.ReplayedOrder"]] = orm.relationship(
|
||||||
|
"ReplayedOrder",
|
||||||
|
back_populates="simulation",
|
||||||
|
)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
"""Non-literal text representation."""
|
"""Non-literal text representation."""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue