X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/a4574508af7d6f7127038fb7837818cc2454001d..e75f306d2a639471d2a5eef2ff698acfcb1fbcb6:/contrib/penfield/utils.py?ds=sidebyside diff --git a/contrib/penfield/utils.py b/contrib/penfield/utils.py deleted file mode 100644 index 5df800c..0000000 --- a/contrib/penfield/utils.py +++ /dev/null @@ -1,20 +0,0 @@ -from django.core.paginator import Paginator, InvalidPage, EmptyPage - - -def paginate(request, entries, entries_per_page): - paginator = Paginator(entries, entries_per_page) - try: - page_number = int(request.GET.get('page', '1')) - entries = paginator.page(page_number).object_list - page = paginator.page(page_number) - except ValueError: - page_number = 1 - entries = paginator.page(page_number).object_list - page = paginator.page(page_number) - try: - entries = paginator.page(page_number).object_list - page = paginator.page(page_number) - except (EmptyPage, InvalidPage): - entries = paginator.page(paginator.num_pages).object_list - page = paginator.page(page_number) - return page \ No newline at end of file