Django无尽的分页url重写

时间:2014-01-18 10:34:25

标签: python django django-endless-pagination

我正在使用Django Endless分页。 (https://github.com/frankban/django-endless-pagination)。无论如何都要将http://example.com/customers/?page=3更改为http://example.com/customers/page/3/

我的模板

<section id="main">
    <section id="innerContent">
        {% if customers %}
        <section class="widget one_by_one">
            <table>             
                <tr>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Mobile</th>
                    <th>Address</th>
                    <th>Action</th>
                </tr>
                {% load endless %}
                {% paginate customers %}
                {% for customer in customers %}
                <tr class="parent">
                    <td>{{ customer.name }}</td>
                    <td>{{ customer.email }}</td>
                    <td>{{ customer.mobile }}</td>
                    <td class="address">{{ customer.address }}</td>
                    <td class="action four">
                        <a href="{%url 'customers:customer' uuid=customer.uuid %}" class="view icon icon-eye"></a>
                        <a href="{%url 'customers:edit_customer' uuid=customer.uuid %}" class="edit icon icon-pencil"></a>
                        <span class="icon delete action icon-trash red" data-action="{% url 'customers:delete_customer' %}" data-id="{{customer.uuid}}"></span>
                    </td>
                </tr>
                {% endfor %}                
            </table>
        </section>
        <section class="widget one_by_one navigation">
            {% get_pages %}
            <h3>Showing Customers <span class="current_page_index">{{ pages.current_start_index }}</span> - <span class="current_end_status">{{ pages.current_end_index }}</span> of <span class="total_count">{{ pages.total_count }}</span></h3>
            <div class="pagination">
                {% show_pages %}
            </div>
            <br class="clear" />
        </section>
        {%else %}
        <section class="widget one_by_one">
            <section id="error404">
                <p class="mbn">Nothing found.</p>
            </section>
        </section>
        {%endif %}
    </section>
</section>

0 个答案:

没有答案