This project has been archived by its maintainers, and is no longer receiving any updates.
Django Pagination Links
Small package for creating a list of page links from a Django paginator object, similar in style to the Django admin - showing the start and end pages, but only showing a limited list of pages in the middle.
Installation
Using pip:
$ pip install django-paginationlinks
Edit your Django project’s settings module, and add paginationlinks:
INSTALLED_APPS = [
# ...
'paginationlinks',
]
Usage
Load the template tag:
{% load pagination_links %}
Typical usage, which shows 1 page on each end, and 1 on each side of the current page:
{% get_pagination_links paginator page_obj as pagination_links %}
However the number of pages on each side can be customised, as well as how many pages at the end - both are optional arguments:
{% get_pagination_links paginator page_obj on_each_side=1 on_ends=2 as pagination_links %}
A more fully featured example for a site:
{% load pagination_links %}
{% if page_obj.has_other_pages %}
{% get_pagination_links paginator page_obj as pagination_links %}
<ul>
{% for page_num in pagination_links %}
{% if page_num.is_current %}
<li class="current">{{ page_num.number }}</li>
{% elif page_num.is_filler %}
<li class="filler">—</li>
{% else %}
<li><a href="?page={{ page_num.number }}">{{ page_num.number }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
Metadata
Release files for django-paginationlinks 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-paginationlinks-0.1.2.tar.gz | 2.7 kB | Without provenance | Details for django-paginationlinks-0.1.2.tar.gz |
Release files / django-paginationlinks-0.1.2.tar.gz
| Download URL | django-paginationlinks-0.1.2.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f1dd7ece5023949a78a525db27118aa27996925eab8d59798d71c5ab6776457
|
|
BLAKE2b-256 checksum How to use checksums |
56b0998c4074cd764889d405f2ce732891d9fccc1d41da7294f2a8cea41a30bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.5.7
|
Security for django-paginationlinks 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.