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 }}
```
================
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 }}
```
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-paginated-0.1.4.tar.gz.
File metadata
- Download URL: django-paginated-0.1.4.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56ea6fc940c37dc47948804e4e5accb0ddc372d8aae00e9439537cf8974cec49
|
|
| MD5 |
82185ac7603cd931101f99de7b0f1e7d
|
|
| BLAKE2b-256 |
a3bc905e131b029cdc21451ea5bfdd5537f9aef87b5418e0a47495e105ac222f
|