feat: use custom type to handle existing naive datetimes
This commit is contained in:
parent
e22abb383c
commit
39bdac1ecf
45 changed files with 210 additions and 84 deletions
|
@ -7,6 +7,7 @@ from sqlalchemy.orm import Mapped, mapped_column
|
|||
from app.brm.brn import BRN
|
||||
from app.extensions import db
|
||||
from app.models import AbstractConfiguration
|
||||
from app.models.types import AwareDateTime
|
||||
|
||||
|
||||
class Activity(db.Model): # type: ignore
|
||||
|
@ -14,7 +15,7 @@ class Activity(db.Model): # type: ignore
|
|||
group_id: Mapped[Optional[int]]
|
||||
activity_type: Mapped[str]
|
||||
text: Mapped[str]
|
||||
added: Mapped[datetime] = mapped_column(db.DateTime(timezone=True))
|
||||
added: Mapped[datetime] = mapped_column(AwareDateTime())
|
||||
|
||||
def __init__(self, *,
|
||||
id: Optional[int] = None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue