diff --git a/backend/routers/shows.py b/backend/routers/shows.py index 130be6c..1898888 100644 --- a/backend/routers/shows.py +++ b/backend/routers/shows.py @@ -109,25 +109,8 @@ def read_shows( shows = session.exec(query.offset(offset).limit(limit)).all() - # Manual population to ensure relationships are serialized - # (Pydantic v2/SQLModel can be tricky with ORM relationships sometimes) - response_shows = [] - for show in shows: - # Convert ORM object to ShowRead explicitly - # We use model_validate to get base fields, then set relationships - s_read = ShowRead.model_validate(show) - - if show.vertical: - s_read.vertical = VerticalSimple.model_validate(show.vertical) - if show.venue: - s_read.venue = VenueRead.model_validate(show.venue) - if show.tour: - s_read.tour = TourRead.model_validate(show.tour) - - response_shows.append(s_read) - return PaginatedResponse( - data=response_shows, + data=shows, meta=PaginationMeta(total=total, limit=limit, offset=offset) )