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