I have this folder structure: folder0.folder1.folder2.folder3.object1 and I want to call within object1, properties from an object0 located at folder1 (within the tree). I know that something like this would work: <dtml-with "folder1.object0"> <dtml-var anyproperty> </dtml-with> But I would like to find an "automatic" way, for wich I don't have to write the "folder.object0" thing, because the code will be used in a product, and it must be able to be used at any folder level. Is there a Python or DTML function that could locate the current object within the tree, and then look backwards for another object? (I haven't find it so far). Any other ideas if not? Thanks in advance, Ausum
ZopeFind as used in \lib\python\OFS\FindSupport.py will find an object. Im not sure what you mean by look backwards, but once you have an object you can rummage through that objects parents and namespace. -- Andy McKay. ----- Original Message ----- From: "Ausum" <augusto@artlover.com> To: <zope@zope.org> Sent: Tuesday, February 06, 2001 2:18 PM Subject: [Zope] A little help on path namespace
I have this folder structure: folder0.folder1.folder2.folder3.object1 and I want to call within object1, properties from an object0 located at folder1 (within the tree). I know that something like this would work:
<dtml-with "folder1.object0"> <dtml-var anyproperty> </dtml-with>
But I would like to find an "automatic" way, for wich I don't have to write the "folder.object0" thing, because the code will be used in a product, and it must be able to be used at any folder level. Is there a Python or DTML function that could locate the current object within the tree, and then look backwards for another object? (I haven't find it so far). Any other ideas if not?
Thanks in advance,
Ausum
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I think look backwards is what is explained in the diet/feed example in the zope book. At 22:34 06/02/2001 , Andy McKay wrote:
ZopeFind as used in \lib\python\OFS\FindSupport.py will find an object. Im not sure what you mean by look backwards, but once you have an object you can rummage through that objects parents and namespace. -- Andy McKay.
*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+ * Ben Edwards lostit@videonetwork.org +44 (0)7970 269 522 * * Campaign Against proper English, Dyslexia division * * Homepage http://www.gifford.co.uk/~bedwards * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol's radical news http://www.bristle.co.uk * * Open Directory Project http://www.dmoz.org * *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
I'm not sure if I understand exactly what you mean, but if I'm close this should work... <dtml-var "object0.anyproperty"> This way you don't have to specify which folder object0 is in. It should find object0 whether it is in folder0, folder1, folder2, or folder3. Hope that helps. Ryan Ausum wrote:
I have this folder structure: folder0.folder1.folder2.folder3.object1 and I want to call within object1, properties from an object0 located at folder1 (within the tree). I know that something like this would work:
<dtml-with "folder1.object0"> <dtml-var anyproperty> </dtml-with>
But I would like to find an "automatic" way, for wich I don't have to write the "folder.object0" thing, because the code will be used in a product, and it must be able to be used at any folder level. Is there a Python or DTML function that could locate the current object within the tree, and then look backwards for another object? (I haven't find it so far). Any other ideas if not?
Thanks in advance,
Ausum
participants (4)
-
Andy McKay -
Ausum -
Ben Edwards -
Ryan M. Dolensek