[Zope] avoiding 'AttributeError'

Dieter Maurer dieter at handshake.de
Wed Mar 30 12:45:05 EST 2005


Malthe Borch wrote at 2005-3-27 01:15 +0100:
>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), if the attribute does not
>exist:
>
><p tal:condition="exists: obj/someAttribute"
>   tal:replace="obj/someAttribute" />

This should not fail and, especially, Zope should not die.

If Zope really dies, then there is a *severe* problem elsewhere
(not with your ZPT code).

-- 
Dieter


More information about the Zope mailing list