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 setting like this::

    INSTALLED_APPS = [
        ...
        'leafage',
    ]
    
  2. 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)
    
    
  3. End of template look like this.

        {% with obj_list=queryset %}
          {% include 'paginator.tpl' %}
        {% endwith %}
    

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-0.3.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

django_leafage-0.3.3-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

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