Created
February 1, 2016 09:19
-
-
Save anishmenon/b4d38d2c9c8091ccb0c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger | |
paginator = Paginator(customers, 30) | |
page = rg('page') | |
try: | |
customers = paginator.page(page) | |
except PageNotAnInteger: | |
customers = paginator.page(1) | |
except EmptyPage: | |
customers = paginator.page(paginator.num_pages) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment