def alter_search(self, search):
    expr = self.get_option('expression')
    column = self.get_option('column')
    field_value = (self.values.get('field') or '')
    from pyasm.biz import ExpressionParser
    parser = ExpressionParser()
    if (field_value or (field_value == 0)):
        results = parser.eval(expr, vars={'REPLACE': field_value, 'VALUE': field_value})
        if results:
            search.add_filters(column, results)
        else:
            search.set_null_filter()
def alter_search(self, search):
    expr = self.get_option('expression')
    column = self.get_option('column')
    field_value = (self.values.get('field') or )
    from pyasm.biz import ExpressionParser
    parser = ExpressionParser()
    if (field_value or (field_value == 0)):
        results = parser.eval(expr, vars={'REPLACE': field_value, 'VALUE': field_value})
        if results:
            search.add_filters(column, results)
        else:
            search.set_null_filter()