mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Fix
This commit is contained in:
10
fastapi_book_server/app/utils/transformer.py
Normal file
10
fastapi_book_server/app/utils/transformer.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import Any, Sequence, TypeVar
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
T = TypeVar("T", bound=BaseModel)
|
||||
|
||||
|
||||
async def dict_transformer(items: Sequence[T]) -> Sequence[dict[str, Any]]:
|
||||
return [item.dict() for item in items]
|
||||
Reference in New Issue
Block a user