'Adds a SQ to the current query.'

def add_filter(self, query_filter, use_or=False):

    if use_or:
        connector = SQ.OR
    else:
        connector = SQ.AND
    if (self.query_filter and (query_filter.connector != connector) and (len(query_filter) > 1)):
        self.query_filter.start_subtree(connector)
        subtree = True
    else:
        subtree = False
    for child in query_filter.children:
        if isinstance(child, tree.Node):
            self.query_filter.start_subtree(connector)
            self.add_filter(child)
            self.query_filter.end_subtree()
        else:
            (expression, value) = child
            self.query_filter.add((expression, value), connector)
        connector = query_filter.connector
    if query_filter.negated:
        self.query_filter.negate()
    if subtree:
        self.query_filter.end_subtree()
