Refactor code and fix formatting issues

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-27 23:46:11 -03:00
commit 6737c845eb
11 changed files with 101 additions and 165 deletions

View file

@ -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")