[Zope] getPhysicalRoot() method

Nico de Boer nico@nfg.nl
26 Jun 2002 09:24:49 +0200


Hi,

I want to get the QUERY_STRING, so I can use it for my <dtml-with>
loop. I heard from Max that you can traverse Zope with a path from code 
directly. You have to use the restrictedTraverse() method..

Asuming that: QUERY_STRING='path/to/training'
You can just do it like:

<dtml-call "REQUEST.set('training',
getPhysicalRoot().restrictedTraverse(QUERY_STRING))">

<dtml.with training>
... etc.

But the getPhysicalRoot() method gives me a NameError:

NameError: global name 'getPhysicalRoot' is not defined

So I tried the following:

<dtml-call "REQUEST.set('training', ROOT().restrictedTraverse(QUERY_STRING))">

Where ROOT is a Python Script in the Root of Zope that does the following:

return container

But 'training' now is an <Application instance at 91b6bf0>.

Can anyone help me with this problem?

Greetz Nico