'A preprocessor for the internal _add_q(). Responsible for doing final
join promotion.'

def add_q(self, q_object):

    existing_inner = {a for a in self.alias_map if (self.alias_map[a].join_type == INNER)}
    (clause, _) = self._add_q(q_object, self.used_aliases)
    if clause:
        self.where.add(clause, AND)
    self.demote_joins(existing_inner)
