----- Original Message -----
Sent: December 10, 2003 5:24 PM
Subject: [Zope] help with
restrictedTraverse
Hi everybody,
The task I am trying to accomplish is to be able to call an
object(it could
be a dtml method, python script, php document, etc), given
its path as a string
parameter.
Let's say my directory structure looks like this:
/-+-Plone-+-homepage
+-reports-+-Site1
+-Site2-+-myObject
+-...
+-...
I need to call myObject, which path is
'/Plone/reports/Site2/', from any
other directory within the directory
structure, but at this time I'm using
homepage.
Browsing the mailing list I found that I could use
restrictedTraverse, so
I created an External Method getObject under the
homepage directory with the
following code:
def getObject( self ):
return
self.restrictedTraverse('/Plone/reports/Site2/myObject')
myObject in this case is a php document that contains:
<?php
?>
Now using the External Method from the homepage's index_html:
<dtml-var getObject>
I also tried creating a python script with the following code:
return
container.restrictedTraverse('/Plone/pig_reports/test_farrowing/crChart')
but the script returns this:
<?php
include
"http://2ksvr/ploneSupp/lines.php?wk=2002-06-01";
?>
What am I doing wrong? Any ideas or help is more than
welcome.
Thanks,
----------------------------------------------------
Ruben
Montejano.
phone: (309) 837-2318
email: rubemontejano@yahoo.com
Do you Yahoo!?
New
Yahoo! Photos - easier uploading and sharing
_______________________________________________
Zope maillist
-
Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**
No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev
)