[Zope] Including Script-Generated String in Method Call

Dan Shafer dan@gui.com
Sun, 30 Dec 2001 01:02:25 -0800


At 8:54 AM +0100 12/30/01, Emmanuel Viennet wrote:
>You can avoid the redirect using Zope function render().
>
>For instance, if the object to display is in the current folder
>(PARENTS[0]), you can write:
>
><dtml-var "_.render(_.getattr(PARENTS[0], name_of_the_doc_to_display ))">
>
>where name_of_the_doc_to_display is a string.
>
>Of course, render() can be called on any object.
>Recall that paths like foo/bar/doc are "equivalent" to
>foo.bar.doc

Thanks. That was informative. But it doesn't seem to work. I get an 
AttributeError on __getslice__. The document I'm trying to render and 
the Python script that generates the string of the URL are both in 
the same folder as the page where this error occurs.

I'm stumped.

Maybe I need to make my Python script an external method?

>Hope this help,
>Emmanuel


-- 
Dan Shafer, Author-Consultant
http://www.danshafer.com
http://www.shafermedia.com