Update page split

This commit is contained in:
Daochen Zha 2020-07-22 00:59:20 -05:00
parent 87c5be2a26
commit 74cfc65501
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ def _get_page(result, elements_every_page, page_index):
page_index = int(page_index) page_index = int(page_index)
total_page = math.ceil(len(result) / float(elements_every_page)) total_page = math.ceil(len(result) / float(elements_every_page))
begin = page_index * elements_every_page begin = page_index * elements_every_page
end = min((page_index+1) * elements_every_page, total_page) end = min((page_index+1) * elements_every_page, len(result))
result = result[begin:end] result = result[begin:end]
return result, total_page return result, total_page