Skip to main content

Simple django digg-style pagination.

Project description

django-paginated
================

Installation
------------

```
pip install django-paginated
```

and add `paginated` to project's `INSTALLED_APPS`


Example
-------

To add pagination just change from:

```python
def events(request):
events = Event.objects.all()

context = {
'events': events,
}
return render_to_response(request, 'events.html', context)
```

to

```python
def events(request):
events, pagination = paginated(Event.objects.all(), request)

context = {
'events': events,
'pagination': pagination,
}
return render_to_response(request, 'events.html', context)
```


and in template add line:

```
{{ pagination|safe }}
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-paginated, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size django-paginated-0.1.4.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page