Type the relationships of Courier
This commit is contained in:
parent
8f5d11db7f
commit
99c8c2ac2e
1 changed files with 5 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
from sqlalchemy.dialects import postgresql as psql
|
from sqlalchemy.dialects import postgresql as psql
|
||||||
|
|
||||||
|
from velofy import db
|
||||||
from velofy.db import meta
|
from velofy.db import meta
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -68,7 +69,10 @@ class Courier(meta.Base):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Relationships
|
# Relationships
|
||||||
orders = orm.relationship("Order", back_populates="courier")
|
orders: orm.Mapped[list["db.Order"]] = orm.relationship(
|
||||||
|
"Order",
|
||||||
|
back_populates="courier",
|
||||||
|
)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
"""Non-literal text representation."""
|
"""Non-literal text representation."""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue