Skip to content

Commit 80a45ef

Browse files
committed
remove args from Fields
1 parent f279fe0 commit 80a45ef

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

backend/python/app/models/enum.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class RoleEnum(str, Enum):
2727

2828

2929
class StatusEnum(str, Enum):
30+
PENDING = "Pending"
3031
RUNNING = "Running"
3132
COMPLETED = "Completed"
3233
FAILED = "Failed"

backend/python/app/models/jobs.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from datetime import datetime
22
from uuid import UUID, uuid4
33

4-
from sqlalchemy import DateTime
54
from sqlmodel import Field, SQLModel
65

76
from .base import BaseModel
@@ -21,21 +20,15 @@ class Jobs(JobsBase, BaseModel, table=True):
2120

2221
__tablename__ = "jobs"
2322

24-
id: UUID = Field(default=uuid4, primary_key=True)
23+
jobs_id: UUID = Field(default_factory=uuid4, primary_key=True)
2524
started_at: datetime | None = Field(
2625
default_factory=datetime.utcnow,
27-
sa_type=DateTime(timezone=True),
28-
description="Timestamp when the record was created",
2926
)
3027
updated_at: datetime | None = Field(
3128
default=None,
32-
sa_type=DateTime(timezone=True),
33-
description="Timestamp when the record was updated",
3429
)
3530
finished_at: datetime | None = Field(
3631
default=None,
37-
sa_type=DateTime(timezone=True),
38-
description="Timestamp when the record is finished",
3932
)
4033

4134

@@ -48,7 +41,7 @@ class JobsCreate(JobsBase):
4841
class JobsRead(JobsBase):
4942
"""Jobs response model"""
5043

51-
id: UUID
44+
jobs_id: UUID
5245
started_at: datetime | None = None
5346
finished_at: datetime | None = None
5447
created_at: datetime

0 commit comments

Comments
 (0)