[Zope] Adding Folders and index_html from Python Script

complaw@hal-pc.org complaw@hal-pc.org
Fri, 23 Mar 2001 23:56:15 GMT


Okay, I'm trying to create a site where the users can load information about 
prospective clients and then add contact information about each client.  This 
is how it works now...

I have a form that creates a folder with the name of the client as the title of 
the folder.  No sweat.  I use...

context.manage_addProduct['OFSP'].manage_addFolder(id=id, title=clientName)

.. which works fine to make the folder itself.

However, there is nothing in the folder (i.e., no index_html file).  Thus, when 
the user moves to the folder, they get the index_html from the parent folder.

Is there a way to add a file to the newly created folder from a Python script? 
 The contents of the file can be very easy (such as "<dtml-var 
standard_html_header><dtml-var standard_html_footer>").

As an asisde, I want to make the id of the folder a string that contains only 
allowable characters that are taken from the name that the users input (with an 
_ used in place of the blanks).  Is there a quick easy way to do that with some 
library function that isn't showing up in the Python Library Reference at 
www.python.org?

Thanks in advance,

Ron