Уведомления

Группа в Telegram: @pythonsu
  • Начало
  • » Django
  • » как организовать разбиение по страницам? [RSS Feed]

#1 Май 28, 2010 10:36:13

tur75
От:
Зарегистрирован: 2010-05-26
Сообщения: 14
Репутация: +  0  -
Профиль   Отправить e-mail  

как организовать разбиение по страницам?

да, отчасти вы правы
однако я нашел раздел по пэйджерированию Pagination на http://docs.djangoproject.com/en/1.2/topics/pagination/#topics-pagination, но там о list_detail.object_list ничего не упомянуто.
да , теперь после вашего замечания я нашел в разделе List/Detail Generic Views на http://djangobook.com/en/1.0/appendixD/ следующее:
* is_paginated: A Boolean representing whether the results are paginated. Specifically, this is set to False if the number of available objects is less than or equal to paginate_by.

If the results are paginated, the context will contain these extra variables:

* results_per_page: The number of objects per page. (This is the same as the paginate_by parameter.)
* has_next: A Boolean representing whether there’s a next page.
* has_previous: A Boolean representing whether there’s a previous page.
* page: The current page number, as an integer. This is 1-based.
* next: The next page number, as an integer. If there’s no next page, this will still be an integer representing the theoretical next-page number. This is 1-based.
* previous: The previous page number, as an integer. This is 1-based.
* pages: The total number of pages, as an integer.
* hits: The total number of objects across all pages, not just this page.

могу еще добавить, не перечисленные здесь.

first obj on_page={{ first_on_page }}<br />
last obj on_page={{ last_on_page }}<br />
отвечаю на свой предыдущий вопрос: “как на уровне шаблона сгенерировать серию тегов для каждой страницы”
перечислить все страницы<br />
{% for i in paginator.page_range %}
N {{ i }}**
{% endfor %}



Офлайн

  • Начало
  • » Django
  • » как организовать разбиение по страницам?[RSS Feed]

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version