1
0
mirror of https://github.com/django/django.git synced 2025-10-27 07:36:08 +00:00

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

This commit is contained in:
Tanner Stirrat
2019-09-20 15:04:34 -06:00
committed by Carlton Gibson
parent 84322a29ce
commit 17595407ca
4 changed files with 25 additions and 2 deletions

View File

@@ -34,6 +34,10 @@ class Paginator:
self.orphans = int(orphans)
self.allow_empty_first_page = allow_empty_first_page
def __iter__(self):
for page_number in self.page_range:
yield self.page(page_number)
def validate_number(self, number):
"""Validate the given 1-based page number."""
try: