Opened 15 years ago
Last modified 6 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 )
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)
Note:
See TracTickets
for help on using tickets.
Reformatted, please use the preview button in the future.