diff --git a/app/core/config.py b/app/core/config.py index cc7da1e..70d5321 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -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() diff --git a/app/schemas/todo.py b/app/schemas/todo.py index 23c46fa..27ec18e 100644 --- a/app/schemas/todo.py +++ b/app/schemas/todo.py @@ -25,5 +25,4 @@ class Todo(TodoBase): created_at: datetime updated_at: datetime - class Config: - orm_mode = True + model_config = {"from_attributes": True}