'Split a list of identifiers into one or more smaller tuples
safe for IN conditions, after uniquifying them.'

def split_for_in_conditions(self, ids, size=None):

    return tools.misc.split_every((size or self.IN_MAX), ids)
