Simple pagination app that saves your time.
Project description
# django-cool-pagination
[![Build Status](https://travis-ci.org/joe513/django-cool-pagination.svg?branch=master)](https://travis-ci.org/joe513/django-cool-pagination)
[![Coverage Status](https://coveralls.io/repos/github/joe513/django-cool-pagination/badge.svg?branch=master)](https://coveralls.io/github/joe513/django-cool-pagination?branch=master)
[![PyPI version](https://badge.fury.io/py/django-cool-pagination.svg)](https://badge.fury.io/py/django-cool-pagination)
*django-cool-pagination* is simple pagination app that saves your time.
## WARNING:
**The project is on development stage, some things may not work properly.**
## Prerequisites
Currently it supports Bootstrap 4.x only. So that you have to add [Bootstrap4](https://getbootstrap.com/docs/4.1/getting-started/download) to your project.
## Installing:
### PIP
pip install django-cool-pagination
## Using
### View
#### FBV (Function based view)
def listing(request):
contact_list = Contacts.objects.all()
paginator = Paginator(contact_list, 25)
page = request.GET.get('page')
page_obj = paginator.get_page(page)
return render(request, 'list.html', {'page_obj': page_obj})
#### CBV (Class based view)
class Listing(ListView):
model = Item
paginate_by = 5
### Template
{% load cool_paginate %}
{% for contact in page_obj %}
...
{% endfor %}
{% cool_paginate %}
## License
This project is licensed under the MIT License - see the LICENSE file for details
[![Build Status](https://travis-ci.org/joe513/django-cool-pagination.svg?branch=master)](https://travis-ci.org/joe513/django-cool-pagination)
[![Coverage Status](https://coveralls.io/repos/github/joe513/django-cool-pagination/badge.svg?branch=master)](https://coveralls.io/github/joe513/django-cool-pagination?branch=master)
[![PyPI version](https://badge.fury.io/py/django-cool-pagination.svg)](https://badge.fury.io/py/django-cool-pagination)
*django-cool-pagination* is simple pagination app that saves your time.
## WARNING:
**The project is on development stage, some things may not work properly.**
## Prerequisites
Currently it supports Bootstrap 4.x only. So that you have to add [Bootstrap4](https://getbootstrap.com/docs/4.1/getting-started/download) to your project.
## Installing:
### PIP
pip install django-cool-pagination
## Using
### View
#### FBV (Function based view)
def listing(request):
contact_list = Contacts.objects.all()
paginator = Paginator(contact_list, 25)
page = request.GET.get('page')
page_obj = paginator.get_page(page)
return render(request, 'list.html', {'page_obj': page_obj})
#### CBV (Class based view)
class Listing(ListView):
model = Item
paginate_by = 5
### Template
{% load cool_paginate %}
{% for contact in page_obj %}
...
{% endfor %}
{% cool_paginate %}
## License
This project is licensed under the MIT License - see the LICENSE file 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
File details
Details for the file django-cool-pagination-0.2.1.tar.gz
.
File metadata
- Download URL: django-cool-pagination-0.2.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d07bbecfcd371a8228bf8da3c8bdf549694d7bb5f75e7f364c707f9fe6d5d825 |
|
MD5 | 86fad8df421df19790e62db2b8c706bd |
|
BLAKE2b-256 | a396de438997239e56a959eb4c41bb221a85896c953ebbf7ebe743f9c537541d |