Table Of Contents

Previous topic

Stores

This Page

Result Sets

Methods

class storm.store.ResultSet
ResultSet.__contains__(item)
Check if an item is contained within the result set.
ResultSet.__getitem__(index)

Get an individual item by offset, or a range of items by slice.

@return: The matching object or, if a slice is used, a new
L{ResultSet} will be returned appropriately modified with C{OFFSET} and C{LIMIT} clauses.
ResultSet.__iter__()
Iterate the results of the query.
ResultSet.one()

Return one item from a result set containing at most one item.

@raises NotOneError: Raised if the result set contains more than one
item.

@return: The object or C{None} if one isn’t available. @seealso: first(), one(), and any().

ResultSet.any()

Return a single item from the result set.

@return: An arbitrary object or C{None} if one isn’t available. @seealso: one(), first(), and last().

ResultSet.first()

Return the first item from an ordered result set.

@raises UnorderedError: Raised if the result set isn’t ordered. @return: The first object or C{None} if one isn’t available. @seealso: last(), one(), and any().

ResultSet.last()

Return the last item from an ordered result set.

@raises FeatureError: Raised if the result set has a C{LIMIT} set. @raises UnorderedError: Raised if the result set isn’t ordered. @return: The last object or C{None} if one isn’t available. @seealso: first(), one(), and any().