Search code examples
ploneuidplone-4.x

Create a folder in Plone and set uid


I have a Plone project which I need to fork; sadly, the UID of the temp folder (for Archetypes objects) is used in the code (as a module level variable, at least, not as strings all over the source tree).

When starting with a fresh ZODB - can I create the temp folder and set the UID? Or should I simply change that constant in the new development branch?


Solution

  • You can set the uid for an AT object by...

    obj._setUID(uid)
    

    The _setUID method is defined in Products.Archetypes.Referencable Module

    For more information you can also check the plone.app.transmogrifier uidupdater section.