def to_python_date(value): date = parse_date(value) if value and not date: raise ValueError('Can\'t convert "{}" to date'.format(value)) return date