Previous topic

Disable send-to form to prevent sending spam

Next topic

Comparisons

This Page

Recursive setCreators snippetΒΆ

# This is a PythonScript for Zope/Plone that sets the creator
#  of the object it is called on and all child objects to USERNAME,
#  which is specified in the script below.
#
# Add a new 'Script (Python)' to the site root and name it change_creators
# Then navigate to an object with:
#  http://example.com/path/to/object/change_creators

new_creator = 'USERNAME'

context.setCreators([new_creator])
for object in context.objectValues():
    if object.isPrincipiaFolderish:
        object.change_creators()
    else:
        object.setCreators([new_creator])
return "Done"