Fix Pydantic errors in Settings and Todo models

This commit is contained in:
Automated Action 2025-05-26 18:38:50 +00:00
parent 328e65d56a
commit 29a334f71f
2 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,5 @@
from pathlib import Path
from typing import ClassVar
from pydantic_settings import BaseSettings
@ -9,13 +10,14 @@ class Settings(BaseSettings):
PROJECT_VERSION: str = "0.1.0"
# Database settings
DB_DIR = Path("/app") / "storage" / "db"
DB_DIR: ClassVar[Path] = Path("/app") / "storage" / "db"
DB_DIR.mkdir(parents=True, exist_ok=True)
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
class Config:
case_sensitive = True
env_file = ".env"
model_config = {
"case_sensitive": True,
"env_file": ".env",
}
settings = Settings()

View File

@ -25,5 +25,4 @@ class Todo(TodoBase):
created_at: datetime
updated_at: datetime
class Config:
orm_mode = True
model_config = {"from_attributes": True}