Opened 8 years ago

Closed 8 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


about this doc page

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 Changed 8 years ago by anonymous

Resolution: invalid
Status: newclosed

wrong version

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