Skip to main content

django-nextpage

Project description

Django NextPage

django-nextpage is modified from django-pagination, but only previous and next page is provided.

Since SQL COUNT statement on large table has poor performance, lots of website turns to show just next and previous page link or button.

How it works?

django-nextpage only execute one SQL statement, no count, no next page determine query.

For example:

If you want to pagiante by 20, django-nextpage will query for 21 items, if queryset length is 21, then we have next page; if queryset length is 20 or less, then we don't have next page.

Installation

Add nextpage to INSTALLED_APPS, like:

    INSTALLED_APPS = (
       # ...
       'nextpage',
    )

and TEMPLATE_CONTEXT_PROCESSORS should have django.core.context_processors.request, like:

    ("django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.request")

Usage

Just like django-pagination, in fact it designed as a drop-in replacement. just load nextpage templatetag

    {% load nextpage %}

    {% autopaginate object_list 20 %}

    {% paginate %}

or you can assign with different pagination template in templates/nextpage folder by

    {% paginate "your_own_pagination.html" %}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-nextpage-1.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

django_nextpage-1.0.2-py2-none-any.whl (5.2 kB view details)

Uploaded Python 2

File details

Details for the file django-nextpage-1.0.2.tar.gz.

File metadata

  • Download URL: django-nextpage-1.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.10

File hashes

Hashes for django-nextpage-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ca52e3d97a244d735b6ff20f7f08c0071952e6c8ff06c8694fffeac59a51e478
MD5 9c3ddc1c954c7de52afb9e9d5b965c8f
BLAKE2b-256 9fff70c895b1716862f55924b25bd3c0a00561481afc12d1e97d1fb107aaf6f0

See more details on using hashes here.

File details

Details for the file django_nextpage-1.0.2-py2-none-any.whl.

File metadata

  • Download URL: django_nextpage-1.0.2-py2-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.10

File hashes

Hashes for django_nextpage-1.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 dd7a516ba860339ab3db9aef032937c591d0a698215d32ac0cd28d406bf16d49
MD5 c64c4ac3c19fba9fc379423fd1ec271a
BLAKE2b-256 c33a7988b0d2faa0dee8127982ed1685ed17f6a8194cb8fe0ca287af96ef6f6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page