Coverage for opt/mealie/lib/python3.12/site-packages/mealie/db/models/server/task.py: 87%
21 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-11-25 15:48 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-11-25 15:48 +0000
1from datetime import datetime 1a
2from typing import TYPE_CHECKING 1a
4from sqlalchemy import ForeignKey, String, orm 1a
5from sqlalchemy.orm import Mapped, mapped_column 1a
7from mealie.db.models._model_base import BaseMixins, SqlAlchemyBase 1a
8from mealie.db.models._model_utils.datetime import NaiveDateTime 1a
9from mealie.db.models._model_utils.guid import GUID 1a
11from .._model_utils.auto_init import auto_init 1a
13if TYPE_CHECKING: 13 ↛ 14line 13 didn't jump to line 14 because the condition on line 13 was never true1a
14 from ..group import Group
17class ServerTaskModel(SqlAlchemyBase, BaseMixins): 1a
18 # Server Tasks are deprecated, but the table still exists in the database
20 __tablename__ = "server_tasks" 1a
21 name: Mapped[str] = mapped_column(String, nullable=False) 1a
22 completed_date: Mapped[datetime] = mapped_column(NaiveDateTime, nullable=True) 1a
23 status: Mapped[str] = mapped_column(String, nullable=False) 1a
24 log: Mapped[str] = mapped_column(String, nullable=True) 1a
26 group_id: Mapped[GUID] = mapped_column(GUID, ForeignKey("groups.id"), nullable=False, index=True) 1a
27 group: Mapped["Group"] = orm.relationship("Group", back_populates="server_tasks") 1a
29 @auto_init() 1a
30 def __init__(self, **_) -> None: 1a
31 pass