fix: explicit from_attributes config for nested schemas
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s

This commit is contained in:
fullsizemalt 2025-12-31 18:39:13 -08:00
parent c9d4266b77
commit 6b9d778b4d
2 changed files with 3 additions and 13 deletions

View file

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

View file

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