From 92098bf0c72ffbfcc404fb55b8ef303641d4ff28 Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Sat, 6 Nov 2010 21:14:39 +0000 Subject: [PATCH] Enable pagination in hosts browsing --- pyi2phosts/templates/browse.html | 4 ++++ pyi2phosts/urls.py | 1 + 2 files changed, 5 insertions(+) diff --git a/pyi2phosts/templates/browse.html b/pyi2phosts/templates/browse.html index 0236d34..8f93fca 100644 --- a/pyi2phosts/templates/browse.html +++ b/pyi2phosts/templates/browse.html @@ -8,4 +8,8 @@ {{ host.description }} {% endfor %} + +{% if is_paginated %} + {% load paginator %}{% paginator 3 %} +{% endif %} {% endblock %} diff --git a/pyi2phosts/urls.py b/pyi2phosts/urls.py index 157e684..c041c4a 100644 --- a/pyi2phosts/urls.py +++ b/pyi2phosts/urls.py @@ -24,6 +24,7 @@ browse_hosts = { 'queryset': i2phost.objects.filter(activated=True).order_by("-last_seen"), 'template_name': 'browse.html', 'template_object_name': 'host', + 'paginate_by': 40, } urlpatterns = patterns('',