=== modified file 'django/core/paginator.py'
--- django/core/paginator.py	2007-06-14 01:54:31 +0000
+++ django/core/paginator.py	2007-07-09 07:37:58 +0000
@@ -86,3 +86,71 @@
 
     hits = property(_get_hits)
     pages = property(_get_pages)
+
+class ObjectPaginatorForPage(object):
+    """
+    This class is used to work with a page of a paginator object.
+    Pass a paginator object, and a valid page number.
+    It uses the same methods as a paginator, except you do not need
+    to use a page number, and also provides some other useful
+    properties.
+
+    `page_number` is always 0-based to match the Paginator object.
+    `base` allows next_page_number, previous_page_number and
+    page_number return their numbers using a different base.
+
+    For example:
+    self, query_set, num_per_page, orphans=0
+    >>> paginator = ObjectPaginatorForPage(query_set, num_per_page, 0, base=1)
+    >>> paginator.next_page_number()
+    2
+    >>> paginator.page_number
+    1
+    """
+    def __init__(self, query_set, num_per_page, page_number=0, base=1, orphans=0):
+        self.paginator = ObjectPaginator(query_set, num_per_page, orphans)
+        # _page_number remains the base-0 page number
+        self._page_number = page_number
+        self.base = base
+        self.num_per_page = num_per_page
+
+    def get_page(self):
+        if not hasattr(self, '_page'):
+            self._page = self.paginator.get_page(self._page_number)
+        return self._page
+
+    def has_next_page(self):
+        return self.paginator.has_next_page(self._page_number)
+
+    def has_previous_page(self):
+        return self.paginator.has_previous_page(self._page_number)
+
+    def first_on_page(self):
+        return self.paginator.first_on_page(self._page_number)
+
+    def last_on_page(self):
+        return self.paginator.last_on_page(self._page_number)
+
+    def _get_hits(self):
+        return self.paginator.hits
+    hits = property(_get_hits)
+
+    def _get_pages(self):
+        return self.paginator.pages
+    pages = property(_get_pages)
+
+    def _get_page_number(self):
+        return self.base + self._page_number
+    page_number = property(_get_page_number)
+
+    def _get_next_page_number(self):
+        if self.has_next_page():
+            # Uses page_number so that we return the correct base
+            return self.page_number + 1
+    next_page_number = property(_get_next_page_number)
+
+    def _get_previous_page_number(self):
+        if self.has_previous_page():
+            # Uses page_number so that we return the correct base
+            return self.page_number - 1
+    previous_page_number = property(_get_previous_page_number)

=== modified file 'django/views/generic/list_detail.py'
--- django/views/generic/list_detail.py	2007-06-14 01:54:31 +0000
+++ django/views/generic/list_detail.py	2007-07-09 07:37:28 +0000
@@ -1,7 +1,7 @@
 from django.template import loader, RequestContext
 from django.http import Http404, HttpResponse
 from django.core.xheaders import populate_xheaders
-from django.core.paginator import ObjectPaginator, InvalidPage
+from django.core.paginator import ObjectPaginatorForPage, InvalidPage
 from django.core.exceptions import ObjectDoesNotExist
 
 def object_list(request, queryset, paginate_by=None, page=None,
@@ -17,57 +17,30 @@
             list of objects
         is_paginated
             are the results paginated?
-        results_per_page
-            number of objects per page (if paginated)
-        has_next
-            is there a next page?
-        has_previous
-            is there a prev page?
-        page
-            the current page
-        next
-            the next page
-        previous
-            the previous page
-        pages
-            number of pages, total
-        hits
-            number of objects, total
-        last_on_page
-            the result number of the last of object in the
-            object_list (1-indexed)
-        first_on_page
-            the result number of the first object in the
-            object_list (1-indexed)
+        paginator
+            paginator object used to navigate the list (if paginated)
     """
     if extra_context is None: extra_context = {}
     queryset = queryset._clone()
     if paginate_by:
-        paginator = ObjectPaginator(queryset, paginate_by)
         if not page:
             page = request.GET.get('page', 1)
         try:
             page = int(page)
-            object_list = paginator.get_page(page - 1)
+            paginator = ObjectPaginatorForPage(queryset, paginate_by, page_number=page - 1)
+            object_list = paginator.get_page()
         except (InvalidPage, ValueError):
             if page == 1 and allow_empty:
                 object_list = []
+                paginator = None
             else:
                 raise Http404
         c = RequestContext(request, {
             '%s_list' % template_object_name: object_list,
-            'is_paginated': paginator.pages > 1,
-            'results_per_page': paginate_by,
-            'has_next': paginator.has_next_page(page - 1),
-            'has_previous': paginator.has_previous_page(page - 1),
-            'page': page,
-            'next': page + 1,
-            'previous': page - 1,
-            'last_on_page': paginator.last_on_page(page - 1),
-            'first_on_page': paginator.first_on_page(page - 1),
-            'pages': paginator.pages,
-            'hits' : paginator.hits,
+            'is_paginated': paginator and paginator.pages > 1 or False,
         }, context_processors)
+        if paginator is not None:
+            c['paginator'] = paginator
     else:
         c = RequestContext(request, {
             '%s_list' % template_object_name: queryset,

