

def prep_search_value(self, term, lookup_type):
    if (test_term in ('exact', 'in', 'range')):
        try:
            date_obj = dateutil.parser.parse(term)
        except ValueError:
            pass
        except TypeError:
            pass
        else:
            return date_obj
    if (lookup_type not in ('exact', 'in', 'range')):
        test_term = term
        if (lookup_type == 'week_day'):
            try:
                test_term = (int(test_term) - 1)
            except:
                return None
            else:
                test_term = str(test_term)
        for test_format in STRPTIME_PLACEHOLDERS[lookup_type]:
            try:
                date_obj = datetime.strptime(test_term, test_format)
            except ValueError:
                pass
            else:
                if (lookup_type == 'week_day'):
                    term = (date_obj.weekday() + 1)
                else:
                    term = getattr(date_obj, lookup_type)
                return str(term)
    return super(DateColumn, self).prep_search_value(term, lookup_type)

dataset/ETHPy150Open pivotal-energy-solutions/django-datatable-view/datatableview/columns.py DateColumn.prep_search_value/VarMisuse@16/22 `lookup_type`->`test_term`