'store custom field metadata into the object. Field is the key name
not the label'

def set_all_user_metadata(self, metadata):

    if (metadata is None):
        traceback.print_stack()
        return
    um = {}
    for (key, meta) in metadata.iteritems():
        m = meta.copy()
        if ('#value#' not in m):
            if ((m['datatype'] == 'text') and m['is_multiple']):
                m['#value#'] = []
            else:
                m['#value#'] = None
        um[key] = m
    _data = object.__getattribute__(self, '_data')
    _data['user_metadata'] = um
