revert: remove manual serialization to fix crash
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
This commit is contained in:
parent
7edec61af1
commit
696d317c6c
1 changed files with 1 additions and 18 deletions
|
|
@ -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)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue