Refactor code and fix formatting issues
This commit is contained in:
parent
8a18027eb0
commit
6737c845eb
11 changed files with 101 additions and 165 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from datetime import datetime,timezone
|
||||
from datetime import datetime, timezone
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
|
|
@ -26,16 +26,10 @@ class Variable(VariableBase, table=True):
|
|||
description="Unique ID for the variable",
|
||||
)
|
||||
# name is unique per user
|
||||
created_at: datetime = Field(
|
||||
default_factory=utc_now, description="Creation time of the variable"
|
||||
)
|
||||
updated_at: Optional[datetime] = Field(
|
||||
None, description="Last update time of the variable"
|
||||
)
|
||||
created_at: datetime = Field(default_factory=utc_now, description="Creation time of the variable")
|
||||
updated_at: Optional[datetime] = Field(None, description="Last update time of the variable")
|
||||
# foreign key to user table
|
||||
user_id: UUID = Field(
|
||||
description="User ID associated with this variable", foreign_key="user.id"
|
||||
)
|
||||
user_id: UUID = Field(description="User ID associated with this variable", foreign_key="user.id")
|
||||
user: "User" = Relationship(back_populates="variables")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue