From e461ccfeec687c719a54370df843876d75f2851e Mon Sep 17 00:00:00 2001 From: TheoLechemia Date: Thu, 20 Jul 2023 14:16:25 +0200 Subject: [PATCH] fix limit not set --- src/utils_flask_sqla/generic.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils_flask_sqla/generic.py b/src/utils_flask_sqla/generic.py index 5837147..d98a1b3 100644 --- a/src/utils_flask_sqla/generic.py +++ b/src/utils_flask_sqla/generic.py @@ -184,7 +184,6 @@ def build_query_filters(self, query, parameters): """ for f in parameters: query = self.build_query_filter(query, f, parameters.get(f)) - return query def build_query_filter(self, query, param_name, param_value): @@ -248,13 +247,12 @@ def raw_query(self, process_filter=True): if not process_filter: return q - if self.filters: unordered_q = self.build_query_filters(q, self.filters) q = self.build_query_order(unordered_q, self.filters) if self.limit != -1: - q.limit(self.limit).offset(self.offset * self.limit) + q = q.limit(self.limit).offset(self.offset * self.limit) return q