[Zope] hasattr

Garito garito at sistes.net
Tue Sep 14 16:25:25 EDT 2004


Thanks for your response Johan
Alexis Roda points me to the correct solution

I use object.hasProperty('someproperty')

Cheers

-----Original Message-----
From: Johan Carlsson <johanc at easypublisher.com>
To: Garito <garito at sistes.net>, zope at zope.org
Date: Tue, 14 Sep 2004 21:09:24 +0200
Subject: Re: [Zope] hasattr

> Garito wrote:
> 
> > Hi all
> > 
> > I've created a Python Script like class with Catalogawarness and 
> > PropertyManager as super classes too
> > 
> > My problems begins when I try to know if these objects has some 
> > properties. If I try these:
> > 
> > hasattr(object.aq_explicit, 'someproperty')
> 
> Why do you try to get 'someproperty' from acquisition?
> 
> Don't you want to check for 'someproperty' in object?
> 
> Hence: hasattr(object, 'someproperty')
> 
> 
> -- 
> Johan Carlsson          Tel: + 46 8 31 24 94
> Colliberty              Mob: + 46 70 558 25 24
> Torsgatan 72            Email: johanc at easypublisher.com
> SE-113 37 STOCKHOLM




More information about the Zope mailing list