def alter_search(self, search):
    keys = []
    for (key, value) in self.values.items():
        if (not key.startswith('button')):
            continue
        if (value != 'on'):
            continue
        keys.append(key)
    search.add_op('begin')
    for key in keys:
        button = self.values.get(('button_%s' % key))
        option = key.replace('button_', '')
        expression = self.get_option(option)
        if expression:
            sobjects = Search.eval(expression)
            ids = [x.get_id() for x in sobjects]
            search.add_filters('id', ids)
    search.add_op('or')
def alter_search(self, search):
    keys = []
    for (key, value) in self.values.items():
        if (not key.startswith('button')):
            continue
        if (value != 'on'):
            continue
        keys.append(key)
    search.add_op('begin')
    for key in keys:
        button = self.values.get(('button_%s' % key))
        option = key.replace('button_', )
        expression = self.get_option(option)
        if expression:
            sobjects = Search.eval(expression)
            ids = [x.get_id() for x in sobjects]
            search.add_filters('id', ids)
    search.add_op('or')