[Zope] getattr and acquisition

Sylvain Thénault Sylvain Thénault
Mon, 16 Dec 2002 18:55:33 +0100


On Monday 16 December à 09:44, Paul Winkler wrote:
> On Mon, Dec 16, 2002 at 06:36:32PM +0100, Sylvain Th?nault wrote:
> > hi,
> > 
> > what's the way to know if an object has an attribute without acquisition?
> 
> You can unwrap the object from its acquisition wrappers:
> 
> getattr(foo.aq_base, "attribute")

and should it be accessible from a restricted python script (or whatever
else like ZPT, DTML...) ? I've just tried and I got an "Attribute Error"

-- 
Sylvain Thénault

  LOGILAB           http://www.logilab.org