[Zope] creating object in local dir from add form in product dir

John Hunter jdhunter@ace.bsd.uchicago.edu
Mon, 25 Mar 2002 12:14:39 -0600


I am developing several ZClasses in a Products dir.  I want managers
to be able to instantiate some of the ZClasses from the /manage
interface and users to be able to instantiate others from a non-manage
URL.  Users will access  

http://some.host:8080/path/to/MedBio305

where MedBio305 is an instance of my ZClass Course which has a Method
index_html that allows users to view the folder.  Within that
index_html file, I have some links which point to the add form of a
Project ZClass that I want users to be able to instantiate:

<a href="/Control_Panel/Products/Course/Project_addForm>upload</a></td>

My Project_addForm calls a python script add method.  I want
that script to instantiate a Project ZClass in
/path/to/MedBio305/, but

context.Project.createInObjectManager(pid,REQUEST)

doesn't work because the /Control_Panel/Products/Course/ dir is the
current context for this script.  Can someone advise how to create the
instance in the MedBio305 dir?  I suspect the answer lies in using the
BASEn, URLn, special variables of the REQUEST object, but don't know
enough about the Zope API to work it out.

Thanks,
John Hunter