diff piecrust/dataproviders/pageiterator.py @ 905:1d0364614665

internal: Sources can cache their pages in addition to their items. Added `getAllPages` to content sources to prevent having to look up cached page objects in the page repository all the time.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 23 Jul 2017 08:26:57 -0700
parents d6d35b2efd04
children abc52a6262a1
line wrap: on
line diff
--- a/piecrust/dataproviders/pageiterator.py	Sun Jul 23 08:25:45 2017 -0700
+++ b/piecrust/dataproviders/pageiterator.py	Sun Jul 23 08:26:57 2017 -0700
@@ -362,9 +362,7 @@
 
     def __iter__(self):
         source = self.source
-        app = source.app
-        for item in source.getAllContents():
-            yield app.getPage(source, item)
+        yield from source.getAllPages()
 
 
 class PaginationDataBuilderIterator: