

def prep_search_value(self, term, lookup_type):
    '\n        Coerce the input term to work for the given lookup_type.  Returns the coerced term, or\n        ``None`` if the term and lookup_type are incompatible together.\n        '
    multi_terms = None
    if (lookup_type == 'in'):
        in_bits = re.split(',\\s*', term)
        if (len(in_bits) > 1):
            multi_terms = in_bits
        else:
            term = None
    if (lookup_type == 'range'):
        range_bits = re.split('\\s*-\\s*', term)
        if (len(range_bits) == 2):
            multi_terms = range_bits
        else:
            term = None
    if multi_terms:
        return filter(None, (self.prep_search_value(multi_term, lookup_type) for multi_term in multi_terms))
    model_field = self.model_field_class()
    try:
        term = model_field.get_prep_value(term)
    except:
        term = None
    return term

dataset/ETHPy150Open pivotal-energy-solutions/django-datatable-view/datatableview/columns.py Column.prep_search_value/original