خرید بک لینک

Vote count: 0

I am working on a Django application and on one of the pages we use pagination. I have around 200 pages and if I am somewhere in the middle then it has links from page 1 - 4, displays the 4 pages behind the page I am on, 3 after the page I am on and the last 4 pages. Looking like this

I would like it so that it shows fewer pages at a time, maybe the first 2, the last 2 and the current page I am on +/- 2.

{% extends 'base.html' %}

{% load pagination_tags %}

{% load staticfiles %}
    {% block body_block %}

        {% autopaginate art 4 %}

        <div class="container">
            {% if item%}
                {% for x in item %}
                    <div class="floated_img">
                        {% if x.picture %}
                            <img src="{{ x.picture.url }}" name="aboutme" width="140" height="140"
                                 class="img-rounded" class="img-responsive">
                        {% else %}
                            <img src="{% static "images/generic.jpg" %}" name="aboutme" width="140" height="140"
                                 class="img-rounded" class="img-responsive">
                        {% endif %}
                        <div class="table-responsive">
                            <p style="text-align: center;">

                                <strong>{{ x.name }}</strong><br>
                                <strong>{{ x.type }}</strong><br>
                                <strong>{{ x.price }}</strong>
                        </div>
                        </p>
                    </div>

                {% endfor %}
                <br>
                </div>
            {% endif %}
        <br>

        {% paginate %}


    {% endblock %}

I have not written any python files for pagination and have just imported things in, I assume I will have to make changes to some of the pagination files and store them within my project to override them but don't know how to go about doing this.

Would be grateful for the help and hope I have given enough information about my problem

asked 25 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 8 تير 1395 ساعت: 17:40

صفحه بندی