c.l.c.d.DecoratedResultSet(object) : class documentation

Part of canonical.launchpad.components.decoratedresultset View In Hierarchy

A decorated Storm ResultSet for 'Magic' (presenter) classes.

Because DistroSeriesBinaryPackage doesn't actually exist in the database, the DistroSeries.searchPackages method uses the DistroSeriesPackageCache object to search for packages within a DistroSeries.

Nonetheless, the users of the searchPackages method (such as the DistroSeriesView) expect a result set of DSBPs. Rather than executing the query prematurely and doing a list comprehension on the complete result set (which could be very large) to convert all the results (even though batching may mean only a window of 10 results is required), this adapted result set converts the results only when they are needed.

This behaviour is required for other classes as well (Distribution, DistroArchSeries), hence a generalised solution.

Method __init__
Method decorate_or_none Decorate a result or return None if the result is itself None
Method copy See IResultSet.
Method config See IResultSet.
Method __iter__ See IResultSet.
Method __getitem__ See IResultSet.
Method any See IResultSet.
Method first See IResultSet.
Method last See IResultSet.
Method one See IResultSet.
Method order_by See IResultSet.
def __init__(self, result_set, result_decorator=None, pre_iter_hook=None, slice_info=False):
Parametersresult_setThe original result set to be decorated.
result_decoratorThe method with which individual results will be passed through before being returned.
pre_iter_hookThe method to be called (with the 'result_set') immediately before iteration starts.
slice_infoIf True pass information about the slice parameters to the result_decorator and pre_iter_hook. any() and similar methods will cause None to be supplied.
def decorate_or_none(self, result, row_index=None):
Decorate a result or return None if the result is itself None
def copy(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated version of the returned result set.
def config(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated result set.after updating the config.
def __iter__(self, *args, **kwargs):
See IResultSet.

Yield a decorated version of the returned value.

def __getitem__(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated version of the returned value.
def any(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated version of the returned value.
def first(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated version of the returned value.
def last(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated version of the returned value.
def one(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated version of the returned value.
def order_by(self, *args, **kwargs):
See IResultSet.
ReturnsThe decorated version of the returned result set.
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.