Code

Opened 9 years ago

Closed 9 years ago

Last modified 7 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: UI/UX:

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'.

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by jacob

  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.