class documentation

class Query(object):

View In Hierarchy

Undocumented

Method __init__ Initializes this class.
Method GetFields Returns the list of fields for this query.
Method OldStyleQuery Query with "old" query result format.
Method Query Execute a query.
Method RequestedData Gets requested kinds of data.
Method RequestedNames Returns all names referenced in the filter.
Instance Variable _fields Undocumented
Instance Variable _filter_datakinds Undocumented
Instance Variable _filter_fn Undocumented
Instance Variable _name_fn Undocumented
Instance Variable _requested_names Undocumented
def __init__(self, fieldlist, selected, qfilter=None, namefield=None):

Initializes this class.

The field definition is a dictionary with the field's name as a key and a tuple containing, in order, the field definition object (objects.QueryFieldDefinition, the data kind to help calling code collect data and a retrieval function. The retrieval function is called with two parameters, in order, the data container and the item in container (see Query.Query).

Users of this class can call RequestedData before preparing the data container to determine what data is needed.

Parameters
fieldlist:dictionaryField definitions
selected:list of stringsList of selected fields
qfilterUndocumented
namefieldUndocumented
def GetFields(self):

Returns the list of fields for this query.

Includes unknown fields.

Returns
List of objects.QueryFieldDefinitionUndocumented
def OldStyleQuery(self, ctx, sort_by_name=True):

Query with "old" query result format.

See Query.Query for arguments.

def Query(self, ctx, sort_by_name=True):

Execute a query.

Parameters
ctxData container passed to field retrieval functions, must support iteration using __iter__
sort_by_name:booleanWhether to sort by name or keep the input data's ordering
def RequestedData(self):

Gets requested kinds of data.

Returns
frozensetUndocumented
def RequestedNames(self):

Returns all names referenced in the filter.

If there is no filter or operators are preventing determining the exact names, None is returned.

_fields =

Undocumented

_filter_datakinds =

Undocumented

_filter_fn =

Undocumented

_name_fn =

Undocumented

_requested_names =

Undocumented