class Result(object):
Invokes a .BakedQuery
against a .Session
.
The _baked.Result
object is where the actual .query.Query
object gets created, or retrieved from the cache,
against a target .Session
, and is then invoked for results.
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. |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __str__ |
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 |
Class Variable | __slots__ |
Undocumented |
Instance Variable | _params |
Undocumented |
Instance Variable | _post_criteria |
Undocumented |
Instance Variable | bq |
Undocumented |
Instance Variable | session |
Undocumented |
return the 'count'.
Equivalent to _query.Query.count
.
Note this uses a subquery to ensure an accurate count regardless of the structure of the original statement.
Return one or zero results, or raise an exception for multiple rows.
Equivalent to _query.Query.one_or_none
.
Return the first element of the first result or None if no rows present. If multiple rows are returned, raises MultipleResultsFound.
Equivalent to _query.Query.scalar
.
Add a criteria function that will be applied post-cache.
This adds a function that will be run against the
_query.Query
object after it is retrieved from the
cache. This currently includes only the
_query.Query.params
and _query.Query.execution_options
methods.
Warning
_baked.Result.with_post_criteria
functions are applied
to the _query.Query
object after the query's SQL statement
object has been retrieved from the cache. Only
_query.Query.params
and
_query.Query.execution_options
methods should be used.