Hello all, This is probably simple, but I'm unable to find anything on it. I'm trying to add a new role to a new folder using a Python script, and am using - context.manage_addFolder(fldr, folders[fldr], 1, 1) # folders is a dictionary # create a new folder named 'fldr' newFolder = getattr(context, fldr) # create reviewer role in folder newFolder.manage_addRole('Reviewer') The last line generates the following error - Line 20: "_addRole" is an invalid attribute name because it starts with "_". I've looked at the source code in Roles.py but can't find an alternative. What should I be doing here? Is there any documentation on this (I can't find anything in the Zope Book either). TIA Samir
Samir Mishra wrote at 2003-2-17 09:49 +0400:
This is probably simple, but I'm unable to find anything on it.
I'm trying to add a new role to a new folder using a Python script, and am using - context.manage_addFolder(fldr, folders[fldr], 1, 1) # folders is a dictionary # create a new folder named 'fldr' newFolder = getattr(context, fldr) # create reviewer role in folder newFolder.manage_addRole('Reviewer')
The last line generates the following error - Line 20: "_addRole" is an invalid attribute name because it starts with "_".
Are you sure? I do not see "_addRole" in your code. Maybe, you post the traceback (and the precise error message) as well. Dieter
participants (2)
-
Dieter Maurer -
Samir Mishra