For Dexterity UUID values, the plone.uuid
package is used. plone.uuid
simply stores the value in a attribute.
The following suffices to set a predetermined UUID on an existing Dexterity object obj
:
from plone.uuid.interfaces import ATTRIBUTE_NAME
setattr(obj, ATTRIBUTE_NAME, uuid)