count articles per section

This commit is contained in:
Andreas Stephanides
2017-01-26 16:16:53 +01:00
parent e3c09974c7
commit c0a091a8c7
2 changed files with 7 additions and 3 deletions

View File

@@ -39,5 +39,9 @@ def get_all_page(lim, off):
def get_section_page(section_id, lim, off):
return Article.query.filter(Article.section_id==section_id).order_by(Article.published_date.desc()).limit(lim).offset(off).all()
def count():
return Article.query.count()
def get_section_page(section_id, lim, off):
return Article.query.filter(Article.section_id==section_id).order_by(Article.published_date.desc()).limit(lim).offset(off).all()
def section_count(section_id):
return Article.filter(Article.section_id==section_id).query.count()