app/soc/views/site/docs/list.py
changeset 263 9b39d93b677f
parent 234 a019afb4b80f
child 265 3c2994f3b85f
--- a/app/soc/views/site/docs/list.py	Thu Oct 02 20:22:15 2008 +0000
+++ b/app/soc/views/site/docs/list.py	Fri Oct 03 01:32:34 2008 +0000
@@ -22,7 +22,7 @@
   ]
 
 
-from soc.logic import document
+from soc.logic import works
 from soc.views import simple
 from soc.views.helpers import list_helpers
 from soc.views.helpers import response_helpers
@@ -56,9 +56,14 @@
   limit = request.GET.get('limit')
 
   offset, limit = list_helpers.getListParemeters(offset=offset, limit=limit)
-  
-  docs = document.getWorksForOffsetAndLimit(
-      offset=offset, limit=limit, cls=soc.models.document.Document)
+
+  # Fetch one more to see if there should be a 'next' link
+  docs = works.getWorksForLimitAndOffset(
+      limit + 1, offset=offset, cls=soc.models.document.Document)
+
+  # 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',