[Zope-dev] Turning acquisition off

Ken Manheimer klm@digicool.com
Wed, 6 Dec 2000 10:13:36 -0500 (EST)


On Wed, 6 Dec 2000, Chris Withers wrote:

> Ken Manheimer wrote:
> > 
> > On Wed, 6 Dec 2000 morten@esol.no wrote:
> > 
> > > Does anyone know how to disable acqusition ?
> > >
> > > That is, with a simple method, and not disabling the Acqusition class,
> > > something like self.aq_disabled('attribute') .
> > 
> > I believe one way is self.aq_base['attribute'].  aq_base gets the
> > unwrapped object (what got __of__'ed). 
> 
> What if the base object's not a dictionary?

I suspect i was missing something, but i assumed since he was referring to
an attribute of the object, that morten did not mean to write a function
call form.  I probably should have presumed toward attribute lookup:
self.aq_base.attribute or getattr(self.aq_base, 'attribute') - and been
explicit that i was reading between the lines, in the first place.

> > If you're not sure the thing
> > is acquisition-wrapped in the first place, you'd probably want to check
> > for the existing of the 'aq_base' attribute before using it...
> 
> Am I imagining things of did Jim F say he might make ac_base present in
> all the acquisition classes so that kind of checking isn't necessary?

Dunno.

Ken
klm@digicool.com