From d688d0f4e61952f82cf477b2f6d11199788ff8f8 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Mon, 30 Oct 2023 14:53:58 +0100 Subject: [PATCH] database:base - fix Cursor.fetchall() behaviour with models --- acacore/database/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acacore/database/base.py b/acacore/database/base.py index d95857a..2850071 100644 --- a/acacore/database/base.py +++ b/acacore/database/base.py @@ -93,7 +93,7 @@ def fetchall(self, model: Optional[Type[M]] = None) -> Generator[Union[dict[str, if model: return ( model.model_validate( - {c.alias or c.name: v for c, v in zip(select_columns, vs)}, + {c.alias or c.name: c.from_entry(v) for c, v in zip(select_columns, vs)}, ) for vs in self.cursor.fetchall() )