Type the relationships of Forecast
Also, move the `db` import to the top
This commit is contained in:
parent
bda9cf69ed
commit
90c0597193
1 changed files with 5 additions and 4 deletions
|
|
@ -8,6 +8,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
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -174,7 +175,10 @@ class Forecast(meta.Base):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Relationships
|
# Relationships
|
||||||
pixel = orm.relationship("Pixel", back_populates="forecasts")
|
pixel: orm.Mapped["db.Pixel"] = orm.relationship(
|
||||||
|
"Pixel",
|
||||||
|
back_populates="forecasts",
|
||||||
|
)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
"""Non-literal text representation."""
|
"""Non-literal text representation."""
|
||||||
|
|
@ -255,6 +259,3 @@ class Forecast(meta.Base):
|
||||||
)
|
)
|
||||||
|
|
||||||
return forecasts
|
return forecasts
|
||||||
|
|
||||||
|
|
||||||
from velofy import db # noqa:E402 isort:skip
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue