I would like to migrate a field with a single relationvalue (choice) with collective.exportimport. The custom exportfile looks fine showing the UUID of the target object. The import is define as follows:
def obj_hook_imagelayer(self, obj, item):
if hasattr(item, 'image_uid') != None:
uuid = item.get('image_uid', None)
if(uuid!=None):
content = api.content.get(UID=uuid)
if content is not None:
#create image (RelationChoice)
intids = component.getUtility(IIntIds)
tartget_uid = intids.getId(content)
rel = RelationValue(tartget_uid)
obj.image = rel
Unfortunatly the obj.image field remains empty. The RelationValue is fine.