b current_page = (start / (page_size or 1)) + 1 page_size_options = [10, 30, 50, 100, 500, 1000] if page_size not in page_size_options: page_size_options.append(page_size) page_size_options.sort() last_record = start + page_size if last_record > total: last_record = total paging_window = 20 half_window = paging_window / 2 pages = total/(page_size or 1) if total % page_size: pages += 1 pages = range(pages) if len(pages) > paging_window: if current_page > half_window: pages = pages[current_page - half_window : current_page + half_window] else: pages = pages[:paging_window] ?>
| Records ${start} - ${last_record} (total: ${total}) Page size:
| ${col['title'] or col['name'].capitalize()}
--- | ---