sqlobject.sresults module

class sqlobject.sresults.SelectResults(sourceClass, clause, clauseTables=None, **ops)[source]

Bases: object

IterationClass

alias of Iteration

accumulate(*expressions)[source]

Use accumulate expression(s) to select result using another SQL select through current connection. Return the accumulate result

accumulateMany(*attributes)[source]

Making the expressions for count/sum/min/max/avg of a given select result attributes. attributes must be a list/tuple of pairs (func_name, attribute); attribute can be a column name (like ‘a_column’) or a dot-q attribute (like Table.q.aColumn)

accumulateOne(func_name, attribute)[source]

Making the sum/min/max/avg of a given select result attribute. attribute can be a column name (like ‘a_column’) or a dot-q attribute (like Table.q.aColumn)

avg(attribute)[source]
clone(**newOps)[source]
connection(conn)[source]
count()[source]

Counting elements of current select results

distinct()[source]
filter(filter_clause)[source]
getOne(default=<class 'sqlobject.sqlbuilder.NoDefault'>)[source]

If a query is expected to only return a single value, using .getOne() will return just that value.

If not results are found, SQLObjectNotFound will be raised, unless you pass in a default value (like .getOne(None)).

If more than one result is returned, SQLObjectIntegrityError will be raised.

lazyColumns(value)[source]
lazyIter()[source]

Returns an iterator that will lazily pull rows out of the database and return SQLObject instances

limit(limit)[source]
max(attribute)[source]
min(attribute)[source]
newClause(new_clause)[source]
orderBy(orderBy)[source]
queryForSelect()[source]
reversed()[source]
sum(attribute)[source]
throughTo