From f7f932d1d0aca9146ceba2f8d8b4b5e9f614e709 Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 1 Jun 2012 00:21:01 +0530 Subject: [PATCH] pagination etc to work --- itf/app/models.py | 2 ++ itf/templates/noel/render_object.html | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/itf/app/models.py b/itf/app/models.py index 6788a5e..b840192 100755 --- a/itf/app/models.py +++ b/itf/app/models.py @@ -340,6 +340,8 @@ class ItfModel(models.Model): return { + 'has_next': results.has_next(), + 'has_previous': results.has_previous(), 'page_no': page_no, 'num_pages': paginator.num_pages, 'items': ret diff --git a/itf/templates/noel/render_object.html b/itf/templates/noel/render_object.html index 25202e1..9c05ad2 100755 --- a/itf/templates/noel/render_object.html +++ b/itf/templates/noel/render_object.html @@ -6,11 +6,15 @@ + + @@ -150,8 +154,8 @@ -
prev
-
next
+ {% if object_list.has_previous %}
prev
{% endif %} + {% if object_list.has_next %}
next
{% endif %}