Skip to main content

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

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-cool-pagination-0.2.0.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file django-cool-pagination-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-cool-pagination-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2ffe2a391bd3ce8b61908e533aee4f2ae9d8ee2e22bb4704e1162415aa0e7b75
MD5 9e55790f0d65fa6b7b05b0b32162f0be
BLAKE2b-256 9aae75d94235bd78a0dd8fc50393a55f2e7e4ff91cc92f17180702a0d599205a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page