count fix 2

This commit is contained in:
Andreas Stephanides
2017-01-26 16:28:39 +01:00
parent 619c0ea121
commit dc835e9788
2 changed files with 6 additions and 1 deletions

View File

@@ -24,12 +24,14 @@ def index():
pp,o=controller.pagination_params(v) # extract per_page and offset from params
if v.has_key("section_id"):
articles=controller.get_section_page(int(v["section_id"]),pp,o)
c=controller.section_count(int(v["section_id"]))
else:
articles=controller.get_all_page(pp,o)
c=controller.count()
resp = jsonify(articles=articles)
resp.headers['Pagination-Limit']=pp
resp.headers['Pagination-Offset']=o
resp.headers['Pagination-TotalCount']=controller.count()
resp.headers['Pagination-TotalCount']=c
return resp
@article_pages.route("/<int:id>",methods=['PUT'])