Skip to content

simas/django-paginated

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-paginated

Installation

pip install django-paginated

and add paginated to project's INSTALLED_APPS

Example

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, 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 }}

About

Simple django digg-style pagination.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published