class documentation

class Result: (source)

View In Hierarchy

Invokes a :class:`.BakedQuery` against a :class:`.Session`. The :class:`_baked.Result` object is where the actual :class:`.query.Query` object gets created, or retrieved from the cache, against a target :class:`.Session`, and is then invoked for results.

Method __init__ Undocumented
Method __iter__ Undocumented
Method __str__ Undocumented
Method all Return all rows.
Method count return the 'count'.
Method first Return the first row.
Method get Retrieve an object based on identity.
Method one Return exactly one result or raise an exception.
Method one_or_none Return one or zero results, or raise an exception for multiple rows.
Method params Specify parameters to be replaced into the string SQL statement.
Method scalar Return the first element of the first result or None if no rows present. If multiple rows are returned, raises MultipleResultsFound.
Method with_post_criteria Add a criteria function that will be applied post-cache.
Class Variable __slots__ Undocumented
Instance Variable bq Undocumented
Instance Variable session Undocumented
Method _as_query Undocumented
Method _iter Undocumented
Method _load_on_pk_identity Load the given primary key identity from the database.
Method _using_post_criteria Undocumented
Instance Variable _params Undocumented
Instance Variable _post_criteria Undocumented
def __init__(self, bq, session): (source)

Undocumented

def __iter__(self): (source)

Undocumented

def __str__(self): (source)

Undocumented

def all(self): (source)

Return all rows. Equivalent to :meth:`_query.Query.all`.

def count(self): (source)

return the 'count'. Equivalent to :meth:`_query.Query.count`. Note this uses a subquery to ensure an accurate count regardless of the structure of the original statement. .. versionadded:: 1.1.6

def first(self): (source)

Return the first row. Equivalent to :meth:`_query.Query.first`.

def get(self, ident): (source)

Retrieve an object based on identity. Equivalent to :meth:`_query.Query.get`.

def one(self): (source)

Return exactly one result or raise an exception. Equivalent to :meth:`_query.Query.one`.

def one_or_none(self): (source)

Return one or zero results, or raise an exception for multiple rows. Equivalent to :meth:`_query.Query.one_or_none`. .. versionadded:: 1.0.9

def params(self, *args, **kw): (source)

Specify parameters to be replaced into the string SQL statement.

def scalar(self): (source)

Return the first element of the first result or None if no rows present. If multiple rows are returned, raises MultipleResultsFound. Equivalent to :meth:`_query.Query.scalar`. .. versionadded:: 1.1.6

def with_post_criteria(self, fn): (source)

Add a criteria function that will be applied post-cache. This adds a function that will be run against the :class:`_query.Query` object after it is retrieved from the cache. This currently includes **only** the :meth:`_query.Query.params` and :meth:`_query.Query.execution_options` methods. .. warning:: :meth:`_baked.Result.with_post_criteria` functions are applied to the :class:`_query.Query` object **after** the query's SQL statement object has been retrieved from the cache. Only :meth:`_query.Query.params` and :meth:`_query.Query.execution_options` methods should be used. .. versionadded:: 1.2

__slots__: tuple[str, ...] = (source)

Undocumented

Undocumented

Undocumented

def _as_query(self): (source)

Undocumented

def _iter(self): (source)

Undocumented

def _load_on_pk_identity(self, session, query, primary_key_identity, **kw): (source)

Load the given primary key identity from the database.

def _using_post_criteria(self, fns): (source)

Undocumented

Undocumented

_post_criteria: list = (source)

Undocumented