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', ... ]
-
Ensure "APP_DIRS" to "True" in settings.py like this::
TEMPLATES = [ { ... 'DIRS': [], 'APP_DIRS': True, ... }, ]
-
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)
-
At beginning of template include following code and template look like this::
{% load leafage %}
-
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
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.2.2.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for django_leafage-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2658b5cd2739e3c139e9bcd611a8bb2f480ab75a840dea9474c534eba4cd8e7 |
|
MD5 | c55de733db2617e7625e5ed19f0b66aa |
|
BLAKE2b-256 | 1e6ef35680bb02f4ad350eb87d3eb540ca348d0440c8a7e066586191889567b3 |