We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ab23e2 commit 482a5caCopy full SHA for 482a5ca
flask_sqlalchemy/__init__.py
@@ -342,6 +342,8 @@ def prev(self, error_out=False):
342
@property
343
def prev_num(self):
344
"""Number of the previous page."""
345
+ if not self.has_prev:
346
+ return None
347
return self.page - 1
348
349
@@ -363,6 +365,8 @@ def has_next(self):
363
365
364
366
def next_num(self):
367
"""Number of the next page"""
368
+ if not self.has_next:
369
370
return self.page + 1
371
372
def iter_pages(self, left_edge=2, left_current=2,
0 commit comments