paginator
import {PaginatorModule} from 'primeng/paginator';
paginator
import {PaginatorModule} from 'primeng/paginator';
paginator.page()
def paginateProjects(request, projects , results ) :
page = request.GET.get('page')
paginator = Paginator(projects, results)
try:
projects = paginator.page(page)
except PageNotAnInteger :
page = 1
projects = paginator.page(page)
except EmptyPage :
page = paginator.num_pages
projects = paginator.page(page)
leftIndex= int(page) -2
if leftIndex < 1 :
leftIndex = 1
rightIndex = int(page) + 3
if rightIndex > paginator.num_pages :
rightIndex = paginator.num_pages + 1
custom_range = range(leftIndex, rightIndex)
return custom_range, projects
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us