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

Itamar Shtull-Trauring itamars@ibm.net
Tue, 02 Nov 1999 13:35:47 +0200


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


Traceback (innermost last):
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/ZPublisher/Publish.py,
line 214, in publish_module
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/ZPublisher/Publish.py,
line 179, in publish
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/Zope/__init__.py, line
201, in zpublisher_exception_hook
    (Object: CatalogAware)
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/ZPublisher/Publish.py,
line 165, in publish
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/ZPublisher/mapply.py, line
160, in mapply
    (Object: edit_properties)
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/ZPublisher/Publish.py,
line 102, in call_object
    (Object: edit_properties)
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/OFS/DTMLMethod.py, line
145, in __call__
    (Object: edit_properties)
  File
/itamar/Zope-2.0.1-linux2-x86/lib/python/DocumentTemplate/DT_String.py,
line 502, in __call__
    (Object: edit_properties)
  File
/itamar/Zope-2.0.1-linux2-x86/lib/python/DocumentTemplate/DT_Util.py, line
321, in eval
    (Object:
manage_renameObject(id,_.string.replace(REQUEST['name_singular'],'
','_')))
  File <string>, line 0, in ?
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/OFS/CopySupport.py, line
250, in manage_renameObject
    (Object: CatalogAware)
  File /itamar/Zope-2.0.1-linux2-x86/lib/python/OFS/ObjectManager.py, line
220, in _getOb
    (Object: CatalogAware)
AttributeError: (see above)


-- 
Itamar - itamars@ibm.net
---------------------------o----------------------------------------------o
 Perl/Gimp Greeting Cards  | Trust? Ha! The US dollar is backed by ICBMs! |
 http://www.sealingwax.com |      --Anonymous Coward, Slashdot            |