[Zope] avoiding 'AttributeError'

Chris Withers chris at simplistix.co.uk
Mon Mar 28 02:40:11 EST 2005


Malthe Borch wrote:

> I can't seem to find an elegant solution to checking if an object has a certain
> attribute. The following fails (i.e. zope dies), 

You probably want to get to tthe bottom of that since i suspect you're 
probably the only person on the planet that applies to ;-)

> <p tal:condition="exists: obj/someAttribute"
>    tal:replace="obj/someAttribute" />

if you're processing stuff, you sghould probably be doing it in a python 
script. ZPT is just for presentation...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list