Simple django digg-style pagiantion.
Project description
================
django-paginated
================
To add pagination just change from:
'''
def events(request):
events = Event.objects.all()
context = {
'events': events,
}
return render_to_response(request, 'events.html', context)
'''
to
'''
def events(request):
events, pagiantion = 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 }}
'''
django-paginated
================
To add pagination just change from:
'''
def events(request):
events = Event.objects.all()
context = {
'events': events,
}
return render_to_response(request, 'events.html', context)
'''
to
'''
def events(request):
events, pagiantion = 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.
Source Distribution
django-paginated-0.1.1.tar.gz
(4.0 kB
view hashes)