@@ -0,0 +1,498 @@
+from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger%0A%0A%0Adef paginate(request, objects, ipp):%0A    paginator = Paginator(objects, ipp)%0A    page = request.GET.get('p')%0A    try:%0A        return paginator.page(page)%0A    except PageNotAnInteger:%0A        # If page is not an integer, deliver first page.%0A        return paginator.page(1)%0A    except EmptyPage:%0A        # If page is out of range (e.g. 9999), deliver last page of results.%0A        return paginator.page(paginator.num_pages)%0A

Add paginate() shortcut