Re: [Zope] Getting a methods parent (in a product)
Thanks a lot, I'll try that. Ole 2005/7/22, Jens Vagelpohl <[EMAIL PROTECTED]>: > > On 22 Jul 2005, at 18:48, Jan-Ole Esleben wrote: > > > Hi! > > > > How can I get a Product instance's _actual_ parent when one of its > > methods is called? (In other ways: how can I find out, from an > > instance, where that instance is located without falling prey to > > acquisition in Zope 2?) > > from Acquisition import aq_inner, aq_parent > > parent = aq_parent(aq_inner(self)) > > This will return the true container the instance is set in, not just > the acquisition parent. > > jens > > ___ > 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 ) > ___ 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 )
Re: [Zope] Getting a methods parent (in a product)
On 22 Jul 2005, at 18:48, Jan-Ole Esleben wrote: Hi! How can I get a Product instance's _actual_ parent when one of its methods is called? (In other ways: how can I find out, from an instance, where that instance is located without falling prey to acquisition in Zope 2?) from Acquisition import aq_inner, aq_parent parent = aq_parent(aq_inner(self)) This will return the true container the instance is set in, not just the acquisition parent. jens ___ 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 )
[Zope] Getting a methods parent (in a product)
Hi! How can I get a Product instance's _actual_ parent when one of its methods is called? (In other ways: how can I find out, from an instance, where that instance is located without falling prey to acquisition in Zope 2?) TIA, Ole ___ 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 )