﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1795	[patch] Addition of page_range in paginator.py and generic.list_detail.py	polarcowz@…	nobody	"When using generic views, the desired effect would be:
    {% if is_paginated %}
    <div class=""tablecontrols"">
        {% for page_number in '''page_range''' %}
            {% ifequal page_number page %}
                {{ page_number }}
            {% else %}
                <a href=""/myapp/clients/{{ page_number }}/"" title=""Go to page {{ page_number }}"">{{ page_number }}</a>
            {% endifequal %}
        {% endfor %}
    </div>
    {% endif %}

to dump out a page list like:

    [1] [2] [3] [4] [5] [6]

Since some searching turned up no way to do this within the view and I imagine this to be a common problem, I patched ""django/core/paginator.py"" and ""django/views/generic/list_detail.py"" to incorporate a new context variable, ""page_range"".  Paginator simply generates a 1-based range up to the total pages.  Attached are the patch files.
"	enhancement	closed	Generic views	dev	normal	fixed	pagination		Ready for checkin	1	0	0	0	0	0
