Merge branch 'date_indexed_collection'
This commit is contained in:
commit
2ff47620f8
@ -231,6 +231,15 @@ class BaseCollection:
|
|||||||
for href in set(hrefs):
|
for href in set(hrefs):
|
||||||
yield self.get(href)
|
yield self.get(href)
|
||||||
|
|
||||||
|
def pre_filtered_list(self, filters):
|
||||||
|
"""List collection items with optional pre filtering.
|
||||||
|
|
||||||
|
This could largely improve performance of reports depending on
|
||||||
|
the filters and this implementation.
|
||||||
|
This returns all event by default
|
||||||
|
"""
|
||||||
|
return [self.get(href) for href, _ in self.list()]
|
||||||
|
|
||||||
def has(self, href):
|
def has(self, href):
|
||||||
"""Check if an item exists by its href.
|
"""Check if an item exists by its href.
|
||||||
|
|
||||||
|
@ -837,7 +837,7 @@ def report(path, xml_request, collection):
|
|||||||
else:
|
else:
|
||||||
# Reference is a collection
|
# Reference is a collection
|
||||||
path = hreference
|
path = hreference
|
||||||
items = [collection.get(href) for href, etag in collection.list()]
|
items = collection.pre_filtered_list(filters)
|
||||||
|
|
||||||
for item in items:
|
for item in items:
|
||||||
if filters:
|
if filters:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user