class Result: (source)
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 |
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 |
Add a criteria function that will be applied post-cache. |
Class Variable | __slots__ |
Undocumented |
Instance Variable | bq |
Undocumented |
Instance Variable | session |
Undocumented |
Method | _as |
Undocumented |
Method | _iter |
Undocumented |
Method | _load |
Load the given primary key identity from the database. |
Method | _using |
Undocumented |
Instance Variable | _params |
Undocumented |
Instance Variable | _post |
Undocumented |
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
Return one or zero results, or raise an exception for multiple rows. Equivalent to :meth:`_query.Query.one_or_none`. .. versionadded:: 1.0.9
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
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