[Zope-dev] Finding specific parent object with acquisition ?

Dyon Balding dyon.balding@monster.com
Wed, 15 Aug 2001 12:01:54 -0700


On Wed, Aug 15, 2001 at 12:34:10PM -0400, Martijn Pieters wrote:
<snip>
> >
> > class ProductB(.....)
> >    def blah():
> >       refProdA = self.acquire('ProductA');
> >
> > (self.acquire is not a real function, only for illustration what kind of
> >  function I would like to have in a Zope object :)
> >
<snip>
> 
> You can simply refer to self.ProductA if you inherit from SimpleItem (it
> includes implicit acquisition). You can also acquire the REQUEST object that
> way, for instance.

to be closer to your example, it would probably be
regProdA = getattr(self, 'ProductA')

-d

-- 
| Dyon Balding . Software Engineer . HiringTools.Monster.com
|   dyon@hiringtools.com . +1 415 288 3375