From fb826fa9c1c41cd26b83fa8119e0a209b6548499 Mon Sep 17 00:00:00 2001 From: Arfey Date: Fri, 5 Apr 2024 03:34:22 +0300 Subject: [PATCH] fixed pagination for prefiltered selects --- .../resources/postgres_resource/postgres_resource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aiohttp_admin2/resources/postgres_resource/postgres_resource.py b/aiohttp_admin2/resources/postgres_resource/postgres_resource.py index 5e32fd4..302f425 100644 --- a/aiohttp_admin2/resources/postgres_resource/postgres_resource.py +++ b/aiohttp_admin2/resources/postgres_resource/postgres_resource.py @@ -176,7 +176,9 @@ async def get_list( else: count: int = await self._execute_scalar( conn, - sa.select(func.count()).select_from(self.get_list_select()) + sa.select(func.count()).select_from( + self.get_list_select() + ) ) return self.create_paginator( instances=res,