[Zope] A better way to acquire or manipulate namespace

Trevor Toenjes zope@toenjes.com
Tue, 15 Jan 2002 23:27:04 -0500


On the journey of enlightenment, I am hoping to understand acquisition
better.
I used a brute force method to solve my problem, but figure there is more
subtle approach someone can show me.

Situation:

with request path... Root.com/myFolder/myDoc/myEdit_script

ROOT
  |
myFolder
  | myDoc -> could be any DTML_Doc in any sub-folder
myMethods
  |method1 -> needs to call <dtml-var id> of myFolder
  |method2
myEdit_script -> calls method1

'myEdit_script'
includes <dtml-call "REQUEST.set('id',id)"> to force 'id' into REQUEST.

'method1'
calls myDoc with <dtml-with REQUEST><dtml-var "_.getitem(_['id'],1)"
html_quote></dtml-with>

This was to avoid inheriting the 'id' of myMethods(Folder).
myDoc could be anywhere in many subfolders.

How do I gracefully call myDoc, from method1, without forcing into REQUEST?
I have unsuccessfully tried aq_parent and aq_explicit, to get past the
myMethods namespace.

TFTH,
Trevor