Index: django/core/paginator.py
===================================================================
--- django/core/paginator.py	(revision 3631)
+++ django/core/paginator.py	(working copy)
@@ -72,10 +72,39 @@
         elif page_number == (self._pages - 1) and (page_number + 1) * self.num_per_page > self._hits:
             return self._hits
         return (page_number + 1) * self.num_per_page
+        
+    def page_list(self, page, page_list_surround, page_list_edges):
+        page_list = []
+        if page_list_surround:
+            surround_start = page-page_list_surround
+            surround_end = (page+page_list_surround)+1
+            if page_list_edges:
+                page_list.extend(range(1, page_list_edges+1))
+                if page_list[-1] < surround_start:
+                    page_list.append("sep")
+            if surround_start <= 1:
+                surround_start = 1
+            else:
+                page_list.append("sep")
+            if surround_end > self.pages-page_list_edges:
+                surround_end = (self.pages-page_list_edges)+1
+            page_list.extend(range(surround_start, surround_end))
+            if page_list_edges:
+                if not self.pages-page_list_edges == surround_end:
+                    page_list.append("sep")
+                page_list.extend(range(self.pages-page_list_edges, self.pages))
+            elif surround_end-1 != self.pages:
+                page_list.append("sep")
+        else:
+            page_list.extend(range(1, self.pages+1))
+        return page_list
 
     def _get_hits(self):
         if self._hits is None:
-            self._hits = self.query_set.count()
+            try:
+                self._hits = self.query_set.count()
+            except TypeError:
+                self._hits = len(self.query_set)
         return self._hits
 
     def _get_pages(self):
Index: django/views/generic/list_detail.py
===================================================================
--- django/views/generic/list_detail.py	(revision 3631)
+++ django/views/generic/list_detail.py	(working copy)
@@ -5,8 +5,9 @@
 from django.core.exceptions import ObjectDoesNotExist
 
 def object_list(request, queryset, paginate_by=None, page=None,
-        allow_empty=False, template_name=None, template_loader=loader,
-        extra_context=None, context_processors=None, template_object_name='object',
+        allow_empty=False, page_list_surround=0, page_list_edges=0,
+        template_name=None, template_loader=loader, extra_context=None,
+        context_processors=None, template_object_name='object', 
         mimetype=None):
     """
     Generic list of objects.
@@ -33,9 +34,24 @@
             number of pages, total
         hits
             number of objects, total
+        page_list
+            a list of containing the page numbers surrounding
+            the current page and the page numbers at the edge
+            (begining and end) depending on the arguments
+            passed
+        first_on_page
+            the result number of the first object in the
+            object_list (where the objects are numbered
+            starting at 1)
+        last_on_page
+            the result number of the last of object in the
+            object_list (where the objects are numbered
+            starting at 1)
     """
-    if extra_context is None: extra_context = {}
-    queryset = queryset._clone()
+    if extra_context is None:
+        extra_context = {}
+    if type(queryset) != type([]):
+        queryset = queryset._clone() #needs to be sequence
     if paginate_by:
         paginator = ObjectPaginator(queryset, paginate_by)
         if not page:
@@ -59,6 +75,9 @@
             'previous': page - 1,
             'pages': paginator.pages,
             'hits' : paginator.hits,
+            'first_on_page': paginator.first_on_page(page - 1),
+            'last_on_page': paginator.last_on_page(page - 1),
+            'page_list': paginator.page_list(page, page_list_surround, page_list_edges),
         }, context_processors)
     else:
         c = RequestContext(request, {
@@ -67,14 +86,18 @@
         }, context_processors)
         if not allow_empty and len(queryset) == 0:
             raise Http404
+            
     for key, value in extra_context.items():
         if callable(value):
             c[key] = value()
         else:
             c[key] = value
     if not template_name:
-        model = queryset.model
-        template_name = "%s/%s_list.html" % (model._meta.app_label, model._meta.object_name.lower())
+        if type(queryset) == type([]):
+            raise AttributeError, "Generic list view must be called with template_name when queryset is a list."
+        else:
+            model = queryset.model
+            template_name = "%s/%s_list.html" % (model._meta.app_label, model._meta.object_name.lower())
     t = template_loader.get_template(template_name)
     return HttpResponse(t.render(c), mimetype=mimetype)
 
