app/soc/views/site/user/list.py
changeset 263 9b39d93b677f
parent 233 42733f531ebf
child 265 3c2994f3b85f
--- a/app/soc/views/site/user/list.py	Thu Oct 02 20:22:15 2008 +0000
+++ b/app/soc/views/site/user/list.py	Fri Oct 03 01:32:34 2008 +0000
@@ -29,6 +29,7 @@
 
 import soc.models.user
 
+
 DEF_SITE_USER_LIST_ALL_TMPL = 'soc/site/user/list/all.html'
 
 def all(request, template=DEF_SITE_USER_LIST_ALL_TMPL):
@@ -55,8 +56,13 @@
   limit = request.GET.get('limit')
 
   offset, limit = list_helpers.getListParemeters(offset=offset, limit=limit)
-  
-  users = id_user.getUsersForOffsetAndLimit(offset=offset, limit=limit)
+
+  # Fetch one more to see if there should be a 'next' link
+  users = id_user.getUsersForLimitAndOffset(limit + 1, offset=offset)
+
+  # TODO(tlarsen): uncomment when pagination select control is working.
+  # form = list_helpers.makeSelectNumItemsForm(request, limit)
+  # context['form'] = form
   
   list_templates = {'list_main': 'soc/list/list_main.html',
                     'list_pagination': 'soc/list/list_pagination.html',
@@ -68,4 +74,4 @@
       offset=offset, limit=limit, list_templates=list_templates)
 
   return response_helpers.respond(request, template, context)
-                 
\ No newline at end of file
+