Opened 14 years ago

Closed 14 years ago

#16085 closed Uncategorized (invalid)

pagination documentary code raises error

Reported by: kaup.steffen@… Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

about this doc page
http://docs.djangoproject.com/en/dev/topics/pagination/?from=olddocs#using-paginator-in-a-view

from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger

def listing(request):
    contact_list = Contacts.objects.all()
    paginator = Paginator(contact_list, 25) # Show 25 contacts per page

    page = request.GET.get('page')


the last line raises error: int() argument must be a string or a number, not 'NoneType'

page = request.GET.get('page',1)

fixed this in my case

Change History (1)

comment:1 by anonymous, 14 years ago

Resolution: invalid
Status: newclosed

wrong version

Note: See TracTickets for help on using tickets.
Back to Top