Opened 14 years ago

Closed 5 years ago

Last modified 5 years ago

#14218 closed New feature (fixed)

Paginator just implement the __iter__ function

Reported by: mlhamel Owned by: Tanner Stirrat
Component: Core (Other) Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Alex Gaynor)

Right now, when you want to iter into all the pages of a Paginator object you to use the page_range function. It would be more logical and naturel to use the normal python of doing that by implementing the iter function like that:

def __iter__(self):
    for page_num in self.page_range:
        yield self.page(page_num)

Change History (9)

comment:1 by Alex Gaynor, 14 years ago

Description: modified (diff)

Reformatted, please use the preview button in the future.

comment:2 by Chris Beaven, 14 years ago

Resolution: wontfix
Status: newclosed

I'm not sure that's common enough functionality to worry about.

comment:3 by Carlton Gibson, 5 years ago

Component: UncategorizedUtilities
Easy pickings: unset
Has patch: set
Needs documentation: set
Needs tests: set
Resolution: wontfix
Severity: Normal
Status: closednew
Triage Stage: UnreviewedAccepted
Type: New feature
UI/UX: unset

So, some 9 years later we have a PR with this exact suggestion implemented...

I'm going to reopen and Accept. Seems reasonable enough, and it's a small addition to enable a kind-of-expected behaviour.

comment:4 by Carlton Gibson, 5 years ago

Component: UtilitiesCore (Other)

comment:5 by Tanner Stirrat, 5 years ago

Owner: changed from nobody to Tanner Stirrat
Status: newassigned

comment:6 by Tanner Stirrat, 5 years ago

Needs documentation: unset
Needs tests: unset
Version: 1.22.2

comment:7 by Carlton Gibson, 5 years ago

Triage Stage: AcceptedReady for checkin

A few edits to squash in on the PR, but this looks ready to go to me.

comment:8 by Carlton Gibson <carlton@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 17595407:

Fixed #14218 -- Added Paginator.iter().

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In f4ac9ae:

Refs #14218 -- Adjusted release note to use present tense.

Thanks to Tim Graham for review.

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