From 6b9d778b4d426e073a6450b4a1ea4a4183d4a2f8 Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Wed, 31 Dec 2025 18:39:13 -0800 Subject: [PATCH] fix: explicit from_attributes config for nested schemas --- backend/routers/shows.py | 13 ------------- backend/schemas.py | 3 +++ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/backend/routers/shows.py b/backend/routers/shows.py index 54f907f..a010c13 100644 --- a/backend/routers/shows.py +++ b/backend/routers/shows.py @@ -109,19 +109,6 @@ def read_shows( shows = session.exec(query.offset(offset).limit(limit)).all() - if shows: - print(f"DEBUG: Loaded {len(shows)} shows") - print(f"DEBUG: First show ID: {shows[0].id}") - print(f"DEBUG: First show Venue: {shows[0].venue}") - print(f"DEBUG: First show Vertical: {shows[0].vertical}") - try: - dump = ShowRead.model_validate(shows[0]).model_dump() - print(f"DEBUG: Serialized Dump: {dump}") - except Exception as e: - print(f"DEBUG: Serialization Error: {e}") - - - return PaginatedResponse( data=shows, meta=PaginationMeta(total=total, limit=limit, offset=offset) diff --git a/backend/schemas.py b/backend/schemas.py index ed56573..58eb5f8 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -59,6 +59,7 @@ class VenueCreate(VenueBase): pass class VenueRead(VenueBase): + model_config = ConfigDict(from_attributes=True) id: int slug: Optional[str] = None @@ -97,6 +98,7 @@ class SongUpdate(SQLModel): # --- Vertical Schema (simple for embedding) --- class VerticalSimple(SQLModel): + model_config = ConfigDict(from_attributes=True) id: int name: str slug: str @@ -226,6 +228,7 @@ class TourCreate(TourBase): pass class TourRead(TourBase): + model_config = ConfigDict(from_attributes=True) id: int slug: Optional[str] = None