def validate_int_or_None(s):
    """if not None, tries to validate as an int"""
    if s=='None':
        s = None
    if s is None:
        return None
    try:
        return int(s)
    except ValueError:
        raise ValueError('Could not convert "%s" to int' % s)