<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -133,6 +133,11 @@ def paginate(context, window=DEFAULT_WINDOW):
         paginator = context['paginator']
         page_obj = context['page_obj']
         page_range = paginator.page_range
+        # Calculate the record range in the current page for display.
+        records = {'first': 1 + (page_obj.number - 1) * paginator.per_page}
+        records['last'] = records['first'] + paginator.per_page - 1
+        if records['last'] + paginator.orphans &gt;= paginator.count:
+            records['last'] = paginator.count
         # First and last are simply the first *n* pages and the last *n* pages,
         # where *n* is the current window size.
         first = set(page_range[:window])
@@ -201,6 +206,7 @@ def paginate(context, window=DEFAULT_WINDOW):
         to_return = {
             'MEDIA_URL': settings.MEDIA_URL,
             'pages': pages,
+            'records': records,
             'page_obj': page_obj,
             'paginator': paginator,
             'is_paginated': paginator.count &gt; paginator.per_page,</diff>
      <filename>pagination/templatetags/pagination_tags.py</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,22 @@
 &gt;&gt;&gt; from django.template import Template, Context
 
 &gt;&gt;&gt; p = Paginator(range(15), 2)
-&gt;&gt;&gt; paginate({'paginator': p, 'page_obj': p.page(1)})['pages']
+&gt;&gt;&gt; pg = paginate({'paginator': p, 'page_obj': p.page(1)})
+&gt;&gt;&gt; pg['pages']
+[1, 2, 3, 4, 5, 6, 7, 8]
+&gt;&gt;&gt; pg['records']['first']
+1
+&gt;&gt;&gt; pg['records']['last']
+2
+
+&gt;&gt;&gt; p = Paginator(range(15), 2)
+&gt;&gt;&gt; pg = paginate({'paginator': p, 'page_obj': p.page(8)})
+&gt;&gt;&gt; pg['pages']
 [1, 2, 3, 4, 5, 6, 7, 8]
+&gt;&gt;&gt; pg['records']['first']
+15
+&gt;&gt;&gt; pg['records']['last']
+15
 
 &gt;&gt;&gt; p = Paginator(range(17), 2)
 &gt;&gt;&gt; paginate({'paginator': p, 'page_obj': p.page(1)})['pages']
@@ -25,8 +39,22 @@
 [1, 2]
 
 &gt;&gt;&gt; p = Paginator(range(21), 2, 1)
-&gt;&gt;&gt; paginate({'paginator': p, 'page_obj': p.page(1)})['pages']
+&gt;&gt;&gt; pg = paginate({'paginator': p, 'page_obj': p.page(1)})
+&gt;&gt;&gt; pg['pages']
 [1, 2, 3, 4, None, 7, 8, 9, 10]
+&gt;&gt;&gt; pg['records']['first']
+1
+&gt;&gt;&gt; pg['records']['last']
+2
+
+&gt;&gt;&gt; p = Paginator(range(21), 2, 1)
+&gt;&gt;&gt; pg = paginate({'paginator': p, 'page_obj': p.page(10)})
+&gt;&gt;&gt; pg['pages']
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+&gt;&gt;&gt; pg['records']['first']
+19
+&gt;&gt;&gt; pg['records']['last']
+21
 
 &gt;&gt;&gt; t = Template(&quot;{% load pagination_tags %}{% autopaginate var 2 %}{% paginate %}&quot;)
 
@@ -127,4 +155,4 @@ True
 &gt;&gt;&gt; request = WSGIRequest({'REQUEST_METHOD': 'POST', 'CONTENT_TYPE': 'multipart', 'wsgi.input': StringIO()})
 &gt;&gt;&gt; middleware.process_request(request)
 &gt;&gt;&gt; request.upload_handlers.append('asdf')
-&quot;&quot;&quot;
\ No newline at end of file
+&quot;&quot;&quot;</diff>
      <filename>pagination/tests.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9e414cdd4ecdd1eaebd9fce9582adb163705f674</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Mizyrycki</name>
    <email>mzdaniel@gmail.com</email>
  </author>
  <url>http://github.com/ericflo/django-pagination/commit/f6c6ae2af328d6cabbd46120d77671c9abf20e3b</url>
  <id>f6c6ae2af328d6cabbd46120d77671c9abf20e3b</id>
  <committed-date>2009-10-16T12:58:23-07:00</committed-date>
  <authored-date>2009-09-12T12:58:42-07:00</authored-date>
  <message>Add records variable in templatetags, allowing to extend the pagination template with the record range displayed in the page.</message>
  <tree>a2772429abcb0175b7df80cb9bc589ec94bfa8ee</tree>
  <committer>
    <name>Eric Florenzano</name>
    <email>floguy@gmail.com</email>
  </committer>
</commit>
