aquiring objects upward in DTML
Hi, Is there an easy way within a DTML method to acquire a named object that may be anywhere upward. At the moment I'm looking at the parent by doing aq_parent['name'] but that only looks one level up. I tried aq_acquire('name') and aq_parent.aq_acquire('name') but they don't work. Thanks, Dan
Just use the object's name in a variable. If do <dtml-var standard_html_footer> DTML will find the "closest" standard_html_footer in the stack, going up to the root folder if need be. -- Andy McKay Agmweb Consulting http://www.agmweb.ca ----- Original Message ----- From: "Dan Jacobs" <dan@caliginous.com> To: <zope@zope.org> Sent: Sunday, August 18, 2002 12:36 PM Subject: [Zope] aquiring objects upward in DTML
Hi,
Is there an easy way within a DTML method to acquire a named object that may be anywhere upward.
At the moment I'm looking at the parent by doing aq_parent['name'] but that only looks one level up. I tried aq_acquire('name') and aq_parent.aq_acquire('name') but they don't work.
Thanks,
Dan
_______________________________________________ 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 )
Andy, I'm not explaining the problem properly... we're iterating through a sequence of object names so aq_parent[ _.getitem('sequence-item')] but that only looks one level up. I tried aq_acquire( _.getitem('sequence-item')) and aq_parent.aq_acquire( _.getitem('sequence-item')) Thanks, Dan On Sun, 18 Aug 2002, Andy McKay wrote:
Just use the object's name in a variable. If do <dtml-var standard_html_footer> DTML will find the "closest" standard_html_footer in the stack, going up to the root folder if need be. -- Andy McKay Agmweb Consulting http://www.agmweb.ca
----- Original Message ----- From: "Dan Jacobs" <dan@caliginous.com> To: <zope@zope.org> Sent: Sunday, August 18, 2002 12:36 PM Subject: [Zope] aquiring objects upward in DTML
Hi,
Is there an easy way within a DTML method to acquire a named object that may be anywhere upward.
At the moment I'm looking at the parent by doing aq_parent['name'] but that only looks one level up. I tried aq_acquire('name') and aq_parent.aq_acquire('name') but they don't work.
Thanks,
Dan
_______________________________________________ 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 )
- Dan Jacobs - 07956 246 659
That didnt help, maybe explain what you are trying to do, rather than how you are doing it... -- Andy McKay Agmweb Consulting http://www.agmweb.ca ----- Original Message ----- From: "Dan Jacobs" <dan@caliginous.com> To: "Andy McKay" <andy@agmweb.ca> Cc: <zope@zope.org>; <yoz@yoz.com> Sent: Monday, August 19, 2002 2:49 AM Subject: Re: [Zope] aquiring objects upward in DTML
Andy,
I'm not explaining the problem properly...
we're iterating through a sequence of object names
so
aq_parent[ _.getitem('sequence-item')] but that only looks one level up. I tried aq_acquire( _.getitem('sequence-item')) and aq_parent.aq_acquire( _.getitem('sequence-item'))
Thanks,
Dan
On Sun, 18 Aug 2002, Andy McKay wrote:
Just use the object's name in a variable. If do <dtml-var standard_html_footer> DTML will find the "closest" standard_html_footer in the stack, going up to the root folder if need be. -- Andy McKay Agmweb Consulting http://www.agmweb.ca
----- Original Message ----- From: "Dan Jacobs" <dan@caliginous.com> To: <zope@zope.org> Sent: Sunday, August 18, 2002 12:36 PM Subject: [Zope] aquiring objects upward in DTML
Hi,
Is there an easy way within a DTML method to acquire a named object that may be anywhere upward.
At the moment I'm looking at the parent by doing aq_parent['name'] but that only looks one level up. I tried aq_acquire('name') and aq_parent.aq_acquire('name') but they don't work.
Thanks,
Dan
_______________________________________________ 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 )
- Dan Jacobs - 07956 246 659
_______________________________________________ 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 )
Maybe try: _.getattr(aq_parent, _.getitem('sequence-item')) hth, -Casey On Monday 19 August 2002 05:49 am, Dan Jacobs wrote:
Andy,
I'm not explaining the problem properly...
we're iterating through a sequence of object names
so
aq_parent[ _.getitem('sequence-item')] but that only looks one level up. I tried aq_acquire( _.getitem('sequence-item')) and aq_parent.aq_acquire( _.getitem('sequence-item'))
Thanks,
Dan
On Sun, 18 Aug 2002, Andy McKay wrote:
Just use the object's name in a variable. If do <dtml-var standard_html_footer> DTML will find the "closest" standard_html_footer in the stack, going up to the root folder if need be. -- Andy McKay Agmweb Consulting http://www.agmweb.ca
----- Original Message ----- From: "Dan Jacobs" <dan@caliginous.com> To: <zope@zope.org> Sent: Sunday, August 18, 2002 12:36 PM Subject: [Zope] aquiring objects upward in DTML
Hi,
Is there an easy way within a DTML method to acquire a named object that may be anywhere upward.
At the moment I'm looking at the parent by doing aq_parent['name'] but that only looks one level up. I tried aq_acquire('name') and aq_parent.aq_acquire('name') but they don't work.
Thanks,
Dan
_______________________________________________ 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 )
- Dan Jacobs - 07956 246 659
_______________________________________________ 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 )
Dan Jacobs writes:
Is there an easy way within a DTML method to acquire a named object that may be anywhere upward.
At the moment I'm looking at the parent by doing aq_parent['name'] but that only looks one level up. You may try:
"getattr(aq_parent,name)" It starts at "aq_parent" looking for "name" and, if unsuccessful, uses acquisition to resolve "name". Dieter
participants (4)
-
Andy McKay -
Casey Duncan -
Dan Jacobs -
Dieter Maurer