Accessing root folder from PythonMethods
I want to be able to access the root folder of Zope from a PythonMethod - is there any easier way than just going up a chain of aq_parent till you hit the end (what's aq_parent then, None?)? -- Itamar - itamars@ibm.net ---------------------------o----------------------------------------------o Perl/Gimp Greeting Cards | Trust? Ha! The US dollar is backed by ICBMs! | http://www.sealingwax.com | --Anonymous Coward, Slashdot |
From: Itamar Shtull-Trauring <itamars@ibm.net>
I want to be able to access the root folder of Zope from a PythonMethod - is there any easier way than just going up a chain of aq_parent till you hit the end (what's aq_parent then, None?)?
Try REQUEST.PARENTS[-1]. The following code lists the contents of the root folder, for example: <params>self, REQUEST</params> return REQUEST.PARENTS[-1].objectIds() Cheers, Evan @ 4-am
Itamar Shtull-Trauring wrote:
I want to be able to access the root folder of Zope from a PythonMethod - is there any easier way than just going up a chain of aq_parent till you hit the end (what's aq_parent then, None?)?
Use PARENTS[-1], which is allways the root folder. -Michel
participants (3)
-
Evan Simpson -
Itamar Shtull-Trauring -
Michel Pelletier