article update

This commit is contained in:
Andreas Stephanides
2017-01-16 13:24:19 +01:00
parent 9dc49e83df
commit 7e90ce324d
3 changed files with 9 additions and 4 deletions

View File

@@ -10,4 +10,4 @@ def get_all():
return Article.query.order_by(Article.published_date.desc()).all()
def search(s):
return Article.query.filter(Article.title.like("%"+s+"%")).order_by(Article.published_date.desc()).all()
return Article.query.filter(Article.title.like("%"+s+"%")).order_by(Article.published_date.desc()).limit(20).all()