'Modify query to filter histories by sharing status.'

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

    if (column_filter == 'All'):
        pass
    elif column_filter:
        if (column_filter == 'private'):
            query = query.filter((self.model_class.users_shared_with == null()))
            query = query.filter((self.model_class.importable == false()))
        elif (column_filter == 'shared'):
            query = query.filter((self.model_class.users_shared_with != null()))
        elif (column_filter == 'accessible'):
            query = query.filter((self.model_class.importable == true()))
        elif (column_filter == 'published'):
            query = query.filter((self.model_class.published == true()))
    return query
