[Zope] How to convert string to object?

Lubos Culen mirsoft@systinet.com
Thu, 06 Mar 2003 15:49:06 +0100


Hi!

Maybe this is more Python question, but because I'm using it with Zope, I'm 
posting it here.

Let's suppose I have DTML Method called e.g. 'index_html' . It has one 
input parameter 'obj' which contains name of existing file object inside 
the directory tree. For example, the index_html file would be called as:

www.mysite.com/path/index_html?obj=path.to.object.file

Then in folder www.mysite.com/path/path/to/object/file in this example 
would be the DTML document I'd like to be displayed. I have to make proper 
code in the index_html file do do this.

I tried do following in index_html:

<dtml-var obj>

But this echoes only plain text ('path.to.object.file') and not the 
object's content. I need to find some way how to convert this string to 
object, so Zope (or Python) can understand it as an object and display its 
content. Is there some way?

Thanks a lot for any answer!

-- 
Regards, Mirsoft