def alter_search(self, search):
    start_col = self.kwargs.get('start_date_col')
    end_col = self.kwargs.get('end_date_col')
    name = self.get_name()
    if (not start_col):
        start_col = ('%s_start_date' % name)
    if (not end_col):
        end_col = ('%s_end_date' % name)
    parts = start_col.split('.')
    search_types = parts[:(- 1)]
    start_col = parts[(- 1)]
    parts = end_col.split('.')
    search_types2 = parts[:(- 1)]
    end_col = parts[(- 1)]
    if (search_types != search_types2):
        raise SearchException('Search types for start and end column must match')
    if search_types:
        search_type = '.'.join(search_types)
    else:
        search_type = search.get_search_type()
    start_date = self.values.get('start_date')
    end_date = self.values.get('end_date')
    if ((not start_date) and (not end_date)):
        return
    from pyasm.common import SPTDate
    start_date = SPTDate.add_local_timezone(start_date)
    start_date = SPTDate.convert(start_date)
    end_date = SPTDate.add_local_timezone(end_date)
    end_date = SPTDate.convert(end_date)
    operator = self.get_option('op')
    if (operator != 'not in'):
        operator = 'in'
    if search_types:
        expr = ('@SEARCH(%s)' % search_type)
        search2 = Search.eval(expr)
    else:
        search2 = Search(search_type)
    search2.add_dates_overlap_filter(start_col, end_col, start_date, end_date, op='in')
    search.add_relationship_search_filter(search2, op=operator)
    return
    '\n        # Add in the ability to do something like ...\n        #select * from sequence where code not in (select distinct sequence_code from shot);\n        relationship = None\n        if relationship == \'search_type\':\n            where = \'\'\'id not in (select distinct search_id from task where search_type like \'prod/asset?project=%\')\'\'\'\n        else:\n            where = \'\'\'id not in (select distinct sequence_code from shot)\'\'\'\n\n        #search.add_empty_related_filter("sthpw/task", op=\'not in\')\n        '
def alter_search(self, search):
    start_col = self.kwargs.get('start_date_col')
    end_col = self.kwargs.get('end_date_col')
    name = self.get_name()
    if (not start_col):
        start_col = ('%s_start_date' % name)
    if (not end_col):
        end_col = ('%s_end_date' % name)
    parts = start_col.split('.')
    search_types = parts[:(- 1)]
    start_col = parts[(- 1)]
    parts = end_col.split('.')
    search_types2 = parts[:(- 1)]
    end_col = parts[(- 1)]
    if (search_types != search_types2):
        raise SearchException('Search types for start and end column must match')
    if search_types:
        search_type = '.'.join(search_types)
    else:
        search_type = search.get_search_type()
    start_date = self.values.get('start_date')
    end_date = self.values.get('end_date')
    if ((not start_date) and (not end_date)):
        return
    from pyasm.common import SPTDate
    start_date = SPTDate.add_local_timezone(start_date)
    start_date = SPTDate.convert(start_date)
    end_date = SPTDate.add_local_timezone(end_date)
    end_date = SPTDate.convert(end_date)
    operator = self.get_option('op')
    if (operator != 'not in'):
        operator = 'in'
    if search_types:
        expr = ('@SEARCH(%s)' % search_type)
        search2 = Search.eval(expr)
    else:
        search2 = Search(search_type)
    search2.add_dates_overlap_filter(start_col, end_col, start_date, end_date, op='in')
    search.add_relationship_search_filter(search2, op=operator)
    return
    '\n        # Add in the ability to do something like ...\n        #select * from sequence where code not in (select distinct sequence_code from shot);\n        relationship = None\n        if relationship == \'search_type\':\n            where = \'\'\'id not in (select distinct search_id from task where search_type like \'prod/asset?project=%\')\'\'\'\n        else:\n            where = \'\'\'id not in (select distinct sequence_code from shot)\'\'\'\n\n        #search.add_empty_related_filter("sthpw/task", op=\'not in\')\n        '