20 Sep
2004
20 Sep
'04
11:40 a.m.
----- Original Message ----- From: "Gregory Gehrich" <greggehrich@yahoo.com>
I want to use a Python script within Zope to create a document. If I have a folder that I want to create it in--no problem, I use getattr and use the name of the folder.
The problem occurs if I want to use the current directory instead. What is need is to use something like getattr with the current directory name.
This should work: #create a DTML Document in the same folder as this python script is running in context.manage_addDTMLDocument('newDoc', 'newTitle') #get the new object ndoc=context.restrictedTraverse('newDoc') #stick some text into the document docContents='Some text' ndoc.manage_edit(docContents, 'aNewTitle') return 'All Done' HTH Jonathan