def alter_search(self, search):
    field_value = self.values.get('field')
    last_mod_value = None
    last_mod_option = self.get_option('last_modified_days')
    if last_mod_option:
        last_mod_value = self.values.get('last_modified')
    search_type = self.get_option('search_type')
    if search_type:
        search_type = Project.get_full_search_type(search_type)
    filter_column = self.get_option('filter_column')
    do_search = self.get_option('do_search')
    if (not field_value):
        if (do_search == 'true'):
            pass
        else:
            return
    column = self.get_option('column')
    assert column
    search2 = Search('sthpw/connection')
    select = search2.get_select()
    from_table = 'connection'
    to_table = 'task'
    from_col = 'src_search_id'
    to_col = 'id'
    select.add_join(from_table, to_table, from_col, to_col, join='INNER')
    prefix = 'src_'
    prefix2 = 'dst_'
    search2.add_filter(('%ssearch_type' % prefix), 'sthpw/task')
    if (not search_type):
        search_type = search.get_search_type()
    search2.add_filter(('%ssearch_type' % prefix2), search_type)
    search2.add_column(('%ssearch_id' % prefix2))
    if field_value:
        search2.add_filter(column, field_value, table='task')
    filters = self.get_option('filters')
    if filters:
        search2.add_op_filters(filters)
    if last_mod_value:
        last_mod_value = int(last_mod_value)
        today = datetime.datetime.today()
        date = (today + relativedelta(days=(- last_mod_value)))
        setting = '%Y-%m-%d'
        date_value = date.strftime(setting)
        search2.add_where(("task.id in (SELECT search_id from status_log where timestamp  > '%s')" % date_value))
    statement = search2.get_statement()
    sql = search2.get_sql()
    values = sql.do_query(statement)
    values = [x[0] for x in values]
    if (not filter_column):
        filter_column = 'id'
    search.add_filters(filter_column, values)
def alter_search(self, search):
    field_value = self.values.get('field')
    last_mod_value = None
    last_mod_option = self.get_option('last_modified_days')
    if last_mod_option:
        last_mod_value = self.values.get('last_modified')
    search_type = self.get_option('search_type')
    if search_type:
        search_type = Project.get_full_search_type(search_type)
    filter_column = self.get_option('filter_column')
    do_search = self.get_option('do_search')
    if (not field_value):
        if (do_search == 'true'):
            pass
        else:
            return
    column = self.get_option('column')
    assert column
    search2 = Search('sthpw/connection')
    select = search2.get_select()
    from_table = 'connection'
    to_table = 'task'
    from_col = 'src_search_id'
    to_col = 'id'
    select.add_join(from_table, to_table, from_col, to_col, join='INNER')
    prefix = 'src_'
    prefix2 = 'dst_'
    search2.add_filter(('%ssearch_type' % prefix), 'sthpw/task')
    if (not search_type):
        search_type = search.get_search_type()
    search2.add_filter(('%ssearch_type' % prefix2), search_type)
    search2.add_column(('%ssearch_id' % prefix2))
    if field_value:
        search2.add_filter(column, field_value, table='task')
    filters = self.get_option('filters')
    if filters:
        search2.add_op_filters(filters)
    if last_mod_value:
        last_mod_value = int(last_mod_value)
        today = datetime.datetime.today()
        date = (today + relativedelta(days=(- last_mod_value)))
        setting = '%Y-%m-%d'
        date_value = date.strftime(setting)
        search2.add_where(("task.id in (SELECT search_id from status_log where timestamp  > '%s')" % date_value))
    statement = search2.get_statement()
    sql = search2.get_sql()
    values = sql.do_query(statement)
    values = [x[0] for x in values]
    if (not filter_column):
        filter_column = 'id'
    search.add_filters(filter_column, values)