Skip to main content

Simple and Easiest paginator for Django.

Project description

Django Leafage

Description

Simple and Easiest paginator for Django.

Installation

pip install django-leafage

Quick start

  1. Add "leafage" to your INSTALLED_APPS in settings.py like this::

    INSTALLED_APPS = [
        ...
        'leafage',
        ...
    ]
    
  2. Ensure "APP_DIRS" to "True" in settings.py like this::

    TEMPLATES = [
        {
            ...
            'DIRS': [],
            'APP_DIRS': True,
            ...
        },
    ]
    
  3. In views import leafage like this::

    import leafage
    
    def home(request):
    """
        Home page handler.
    """
    template = 'home.html'
    
    per_page_obj = 10 # default = 10(if not provided)
    
    queryset = Model.objects.all()
    queryset = leafage.pagination(request=request, obj_list=queryset, obj_count=per_page_obj)
    
    context = {
        'queryset': queryset
    }
    return render(request, template, context)
    
    
  4. At beginning of template include following code and template look like this::

    {% load leafage %}
    
  5. End of template add following code look like this::

    {% paginate request=request object_list=queryset %}
    

Licence

Copyright (c) 2020 Nilesh Kumar Dubey

This repository is licensed under the MIT license. See LICENSE for details

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-leafage-1.2.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

django_leafage-1.2.5-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file django-leafage-1.2.5.tar.gz.

File metadata

  • Download URL: django-leafage-1.2.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.5

File hashes

Hashes for django-leafage-1.2.5.tar.gz
Algorithm Hash digest
SHA256 116980c76df49501278a89efc5fecc0bbecb5c53edb32c49cfe6e0447487447e
MD5 abda47ce8eefd8e42d191628bbde8e5c
BLAKE2b-256 aceae6e695a4548ee783e7d345ff4d75d071ca29d3b296a3892b06e639bfc06b

See more details on using hashes here.

File details

Details for the file django_leafage-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: django_leafage-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.5

File hashes

Hashes for django_leafage-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0ad9bd669d6f7e21a9d291d68ac76d6ad02e488f53965e3599b2067ca3700f34
MD5 0a73fe1c09880eddf805bc44109402ea
BLAKE2b-256 c96d5e40b06b3b5cb25eb1b830edf5f09343d44b1bd2f2aa3fa5ed562f7a5ad2

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