Set UID for Dexterity type

I am transferring content from Archetypes to Dexterity, and I need new elements for the same UID as the old ones.

In Archetypes elements, I can call context._setUID ('my-uid'). Is there something similar for Dexterity?

+4
source share
1 answer

For UUID Dexterity values, the plone.uuid package is used . plone.uuid just stores the value in the attribute.

It is enough to set a predefined UUID for an existing obj agility object:

 from plone.uuid.interfaces import ATTRIBUTE_NAME setattr(obj, ATTRIBUTE_NAME, uuid) 
+5
source

All Articles