Opened 5 years ago

Closed 5 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:


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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

wrong version

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