[Zope] using aq vs. REQUEST to get an object
Trevor Toenjes
zope@toenjes.com
Wed, 16 Jan 2002 16:03:21 -0500
I used REQUEST as a brute force method to solve my problem, but figure there
is a "better way."
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.
request path... Root.com/myFolder/myDoc/myEdit_script
ROOT
|
myFolder
| myDoc
myMethods
|method1
|method2
myEdit_script
'myEdit_script'
includes <dtml-call "REQUEST.set('id',id)"> to force 'id' into REQUEST.
and <dtml-with myMethods><dtml-var method1></dtml-with>
'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.
TFTH,
Trevor