[Zope] How can I rename an object from inside DTML?

Kevin Dangoor kid@kendermedia.com
Tue, 2 Nov 1999 08:53:11 -0500


When you say "trying to rename itself", I assume you mean that the
manage_renameObject call below is actually done in a method of 'white_wine's
ZClass. manage_renameObject should actually be called on the ObjectManager
that contains white_wine. You could probably do:

<dtml-call "PARENTS[1].manage_renameObject(id,
_.string.replace(REQUEST['name_singular'],'', '_'))">
(Not sure about those last couple parameters.... my main point was just that
tacking a PARENTS[1] onto the beginning could fix it.)

Kevin

-----Original Message-----
From: Itamar Shtull-Trauring <itamars@ibm.net>
To: zope@zope.org <zope@zope.org>
Date: Tuesday, November 02, 1999 7:20 AM
Subject: [Zope] How can I rename an object from inside DTML?


>When trying to do this in a method of a ZClass instance called
'white_wine',
>which is trying to rename itself:
><dtml-call
>"manage_renameObject(id,_.string.replace(REQUEST['name_singular'],'
>','_'))">
>
>I get the following error:
>###########################################################################
##
>
>Zope Error
>
>             Zope has encountered an error while publishing this resource.
>
>             Error Type: AttributeError
>             Error Value: white_wine