Opened 14 years ago

Last modified 5 years ago

#14218 closed

Paginator just implement the __iter__ function — at Version 1

Reported by: mlhamel Owned by: nobody
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 (1)

comment:1 by Alex Gaynor, 14 years ago

Description: modified (diff)

Reformatted, please use the preview button in the future.

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