Skip to content

Commit 4264d8e

Browse files
perf: Optimize Formatted Pagination Query Results
1 parent a5ab618 commit 4264d8e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/common/core/pagination.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def _process_result_row(self, row: Row) -> Dict[str, Any]:
1414
result_dict = {}
1515
if isinstance(row, int):
1616
return {'id': row}
17+
if isinstance(row, SQLModel) and not hasattr(row, '_fields'):
18+
return row.model_dump()
1719
for item, key in zip(row, row._fields):
1820
if isinstance(item, SQLModel):
1921
result_dict.update(item.model_dump())

0 commit comments

Comments
 (0)