def METHOD_NAME(self, q: Select) -> Select:
    for col, val in self.filters:
        if is_listish(val):
            q = q.where(self.get_column(col).in_(val))
        else:
            q = q.where(self.get_column(col) == val)
    for col, val in self.filters_not:
        if is_listish(val):
            q = q.where(self.get_column(col).notin_(val))
        else:
            q = q.where(self.get_column(col) != val)
    # not sure this is a great idea:
    # if self.data.get('where'):
    #    q = q.where(sql_text(self.data.get('where')))
    for join in self.joins:
        left = self.get_column(join.get("left"))
        right = self.get_column(join.get("right"))
        q = q.where(left == right)
    return q