xtuml/meta.py
def _is_null(instance, name):
    '''
    Determine if an attribute of an *instance* with a specific *name* 
    is null.
    '''
    if name in instance.__dict__:
        value = instance.__dict__[name]
    else:
        value = getattr(instance, name)

    if value:
        return False
    
    elif value is None:
        return True

    name = name.upper()
    metaclass = get_metaclass(instance)
    for attr_name, attr_ty in metaclass.attributes:
        if attr_name.upper() != name:
            continue

        attr_ty = attr_ty.upper()
        if attr_ty == 'UNIQUE_ID':
            # UUID(int=0) is reserved for null
            return value == 0

        elif attr_ty == 'STRING':
            # empty string is reserved for null
            return len(value) == 0

        else:
            #null-values for integer, boolean and real are not supported
            return False
def _is_null(instance, name):
    '''
    Determine if an attribute of an *instance* with a specific *name* 
    is null.
    '''
    if name in instance.__dict__:
        value = instance.__dict__[name]
    else:
        value = getattr(instance, name)

    if value:
        return False
    
    elif value is None:
        return True

    name = name.upper()
    metaclass = get_metaclass(instance)
    for attr_name, attr_ty in metaclass.attributes:
        if attr_name.upper() != name:
            continue

        attr_ty = attr_ty.upper()
        if attr_ty == 'UNIQUE_ID':
            # UUID(int=0) is reserved for null
            return value == 0

        elif attr_ty == 'STRING':
            # empty string is reserved for null
            return len(value) == 0

        else:
            #null-values for integer, boolean and real are not supported
            return False
Determine if an attribute of an *instance* with a specific *name* 
    is null.