Skip to content

Commit

Permalink
review corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Corny committed Apr 17, 2024
1 parent 9f16794 commit 5762bdf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/utils_flask_sqla/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,18 @@ class GenericQuery:
def __init__(
self,
DB,
tableName,
schemaName,
filters=[],
limit=100,
offset=0,
tableName:str,
schemaName:str,
filters:list=[],
limit:int=None,
offset:int=0,
):
self.DB = DB
self.tableName = tableName
self.schemaName = schemaName
self.filters = filters
if limit:
assert limit > 0
self.limit = limit
self.offset = offset
self.view = GenericTable(tableName, schemaName, DB.engine)
Expand Down Expand Up @@ -254,7 +256,7 @@ def raw_query(self, process_filter=True):
unordered_q = self.build_query_filters(q, self.filters)
q = self.build_query_order(unordered_q, self.filters)

if self.limit != -1:
if self.limit:
q = self.set_limit(q)

return q
Expand Down

0 comments on commit 5762bdf

Please sign in to comment.