pagination header

This commit is contained in:
Andreas Stephanides
2017-01-21 21:58:37 +01:00
parent 31f0001b12
commit 7271157d11
3 changed files with 9 additions and 15 deletions

View File

@@ -11,3 +11,6 @@ def get_all():
def search(s):
return Article.query.filter(Article.title.like("%"+s+"%")).order_by(Article.published_date.desc()).limit(20).all()
def get_all_page(lim, off):
return Article.query.order_by(Article.published_date.desc()).limit(lim).offset(off).all()