def alter_search(self, search):
    expression = self.kwargs.get('column')
    if (not expression):
        expression = self.get_name()
    search_types = []
    if (expression.find('.') != (- 1)):
        parts = expression.split('.')
        search_types = parts[:(- 1)]
        if search_types:
            search_type = '.'.join(search_types)
        date_col = parts[(- 1)]
    else:
        search_type = search.get_search_type()
        date_col = expression
    start_date = self.values.get('start_date')
    end_date = self.values.get('end_date')
    if ((not start_date) and (not end_date)):
        return
    if (isinstance(start_date, six.string_types) and start_date.startswith('$')):
        start_date = parser.parse(Search.eval(start_date))
    if (isinstance(end_date, six.string_types) and end_date.startswith('$')):
        end_date = parser.parse(Search.eval(end_date))
    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)
    if search_types:
        expr = ('@SEARCH(%s)' % search_type)
        search2 = Search.eval(expr)
    else:
        search2 = Search(search_type)
    search2.add_date_range_filter(date_col, start_date, end_date)
    search.add_relationship_search_filter(search2)
def alter_search(self, search):
    expression = self.kwargs.get('column')
    if (not expression):
        expression = self.get_name()
    search_types = []
    if (expression.find('.') != (- 1)):
        parts = expression.split('.')
        search_types = parts[:(- 1)]
        if search_types:
            search_type = '.'.join(search_types)
        date_col = parts[(- 1)]
    else:
        search_type = search.get_search_type()
        date_col = expression
    start_date = self.values.get('start_date')
    end_date = self.values.get('end_date')
    if ((not start_date) and (not end_date)):
        return
    if (isinstance(start_date, six.string_types) and start_date.startswith('$')):
        start_date = parser.parse(Search.eval(start_date))
    if (isinstance(end_date, six.string_types) and end_date.startswith('$')):
        end_date = parser.parse(Search.eval(end_date))
    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)
    if search_types:
        expr = ('@SEARCH(%s)' % search_type)
        search2 = Search.eval(expr)
    else:
        search2 = Search(search_type)
    search2.add_date_range_filter(date_col, start_date, end_date)
    search.add_relationship_search_filter(search2)