Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#523 closed defect (invalid)

object_list sets current page number incorrectly

Reported by: marcink Owned by: Jacob
Component: Generic views Version:
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In django/views/generic/list_detail.py:

        c = Context(request, {
            [...]
            'page': page + 1,
            'next': page + 1,
            'previous': page - 1,
            'pages': paginator.pages,
        })

'page' is set to the same value as 'next'.

Change History (1)

comment:1 by Jacob, 19 years ago

Resolution: invalid
Status: newclosed

This is, actually, correct -- page is designed to be used as

   Page {{ page }} of {{ pages }}

(i.e. "Page 3 of 5"). So page is one-indexed, but next and prev are zero-indexed.

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