'Modify query to filter model_class by tag. Multiple filters are ANDed.'

def filter(self, trans, user, query, column_filter):

    if (column_filter == 'All'):
        return query
    if isinstance(column_filter, list):
        clause_list = []
        for filter in column_filter:
            part_clause_list = []
            for column in self.cols_to_filter:
                part_clause_list.append(column.get_filter(trans, user, filter))
            clause_list.append(or_(*part_clause_list))
        complete_filter = and_(*clause_list)
    else:
        clause_list = []
        for column in self.cols_to_filter:
            clause_list.append(column.get_filter(trans, user, column_filter))
        complete_filter = or_(*clause_list)
    return query.filter(complete_filter)
