'Add a Q-object to the current filter.'

def _add_q(self, q_object, used_aliases, branch_negated=False, current_negated=False, allow_joins=True, split_subq=True):

    connector = q_object.connector
    current_negated = (current_negated ^ q_object.negated)
    branch_negated = (branch_negated or q_object.negated)
    target_clause = self.where_class(connector=connector, negated=q_object.negated)
    joinpromoter = JoinPromoter(q_object.connector, len(q_object.children), current_negated)
    for child in q_object.children:
        if isinstance(child, Node):
            (child_clause, needed_inner) = self._add_q(child, used_aliases, branch_negated, current_negated, allow_joins, split_subq)
            joinpromoter.add_votes(needed_inner)
        else:
            (child_clause, needed_inner) = self.build_filter(child, can_reuse=used_aliases, branch_negated=branch_negated, current_negated=current_negated, allow_joins=allow_joins, split_subq=split_subq)
            joinpromoter.add_votes(needed_inner)
        if child_clause:
            target_clause.add(child_clause, connector)
    needed_inner = joinpromoter.update_join_types(self)
    return (target_clause, needed_inner)
