A class representing a selection of results.
Interaction with objects based on this class is typically done using
the 'get_query' method, and this method makes uses of the '_get_query'
mechanism described below in order to produce a suitable top-level query
that produces results of the expected form.
This class provides a '_get_query' method which produces the core of
most querying operations, comprising mostly of producing conditions based
on each object's pattern, ordering and limit information. Where patterns
specified in the initialisation of objects involve other objects based on
this class, such objects are requested to provide a subquery via the
'get_subquery' method which itself provides a means of combining an outer
query with a specific subquery (which in turn is produced by '_get_query'
for that object).
Method Summary |
|
__init__ (self,
store,
pattern,
fn,
ordering,
limit)
Initialise the results object with the given 'store', 'pattern',
optional 'ordering' description and optional 'limit' criteria. |
|
_apply_function(self,
fn,
column)
|
|
_get_order_column(self,
index)
|
|
_get_order_extent(self)
|
|
_get_query (self,
select_clause,
index,
constraints)
Build the query conditions and return a usable query which starts with
the supplied 'select_clause' and which uses the given table 'index'
number as qualifier. |
Inherited from Query |
|
__getitem__ (self,
i)
|
|
__len__ (self)
|
|
__repr__ (self)
|
|
get_child_query (self,
index)
Obtain the query clause and values (as a 2-tuple) which links this
object's query to a parent query. |
|
_ensure (self)
|