[Zope] how can I ask an object whether it is folderish?
Chris Withers
chrisw@nipltd.com
Wed, 10 Oct 2001 12:04:06 +0100
Andrew Kenneth Milton wrote:
>
> I'm pretty sure getattr will trigger the Acquisition machinery, I don't know
> if hasattr does. Might be better to unwrap the object first before checking.
they both do :-S
If you want to be very hostile, you could always do:
if object.__dict__.get('isPrincipiaFolderish'):
...no acquisition there ;-)
Probably slightly mroe friendly (adn possible in a PythonScript?)
if getattr(aq_explicit(object),'isPrincipiaFolderish',None):
cheers,
Chris