[Zope-dev] aq_inner: don't call it!

Jim Fulton jim@digicool.com
Tue, 26 Sep 2000 07:21:51 -0400


Chris Withers wrote:
> 
> After more playing I've discovered that calling the resutl of aq_inner()
> appears to be a very bad idea ;-)
> 
> The line:
>         print self.aq_inner()
> 
> in the __call__ method of a python product caused the python process to
> dump an 'unknown software exception'.
> 
> Should that be so?

No. Sound's like a bug. Would you mind submitting a collector entry?

> Also, I thought aq_inner gave the contaiment context (presumably as a
> list?) but it just returns a single object.

It returns the innermost wrapped objects. IOW, it stips
off all levels of wrapping except one.


> So, how can I get the containment context of an object as a list?

See:

http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionModuleInterface

In particular:

  Acquisition.aq_chain(ob,1)

More acquisition pointers can be found at:

  http://www.zope.org/Members/michel/Projects/Interfaces/Acquisition

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.