def int_check(self, value, key):
    """
    Cast a value as an integer
    :param value: The value to cast as int
    :param key: The value name
    :return: The value as an integer, otherwise an error message
    """

    try:
        int(value)
        return int(value), ''
    except:
        return None, 'Error: %s value must be a integer' % (key)