'Returns whether or not all elements of this q_object need to be put
together in the HAVING clause.'

def need_force_having(self, q_object):

    for child in q_object.children:
        if isinstance(child, Node):
            if self.need_force_having(child):
                return True
        elif (child[0].split(LOOKUP_SEP)[0] in self.aggregates):
            return True
    return False
