[Zope] Best Python Method to Rename Object

Max M maxm@mxm.dk
Thu, 18 Jul 2002 16:02:02 +0200


Chris A. Bruce wrote:

> Can someone tell me what the best method to use for renaming an object 
> in both python script and python? Would you use "manage_renameObject" 
> or is can I just do object.id = new_id?
>

You need to use the method. The id is saved in several places: first in 
the objects as an 'id' attribute, then in the objectmanager as a key, 
and as far as I know it is also stored in a special tuple in the 
objectmanager which I believe is for speed considderations.

So my guess is that you can get into all kinds of trouble if you just 
change the id on the object.

regards Max M.

-- 

"Sorry I would Really Like To Help More On This Project,
But Am To Busy Doing Paid Work On A Tight Deadline"
    Max M