mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-10 18:30:22 +01:00
11 lines
231 B
Python
11 lines
231 B
Python
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]
|