Personal tools
You are here: Home Programming Code Snippets Recursive Python Script - setCreators

Recursive Python Script - setCreators

by Brent Woodruff last modified Nov 23, 2008 03:47 AM

This is a Python Script for Zope/Plone that sets the creator of the object to USERNAME.

# Add a new Script (Python) to the site root and name it 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"
Document Actions