Simple and Easiest paginator for Django.
Project description
Django Leafage
Description
Simple and Easiest paginator for Django.
Installation
pip install django-leafage
Quick start
-
Add "leafage" to your INSTALLED_APPS in settings.py like this::
INSTALLED_APPS = [ ... 'leafage', ... ]
-
Add "leafage.app_path" to your TEMPLATE DIRS in settings.py like this
TEMPLATES = [ { ... 'DIRS': [..., 'leafage.app_path'], ... }, ]
-
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)
-
End of template add following code look like this::
{% with obj_list=queryset %} {% include 'paginator.html' %} {% endwith %}
Licence
Copyright (c) 2020 Nilesh Kumar Dubey
This repository is licensed under the MIT license. See LICENSE for details
Project details
Release history Release notifications | RSS feed
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.0.0.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for django_leafage-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8256a98671321d8fc026aec9e6d91568638ba30ea028c09da54100004d674e8 |
|
MD5 | a8ac7e31da7243ed4cd208c8b65b7469 |
|
BLAKE2b-256 | 5a0b6dfc7944ec633bc295dbfa3c3fb755fc14e2b12c2c1eb55de5529923c311 |