[Zope] How do I check for existence of a page?

Joel Burton jburton@scw.org
Wed, 28 Feb 2001 19:47:53 -0500 (EST)


On Wed, 28 Feb 2001, Dieter Maurer wrote:

> You should not use a "dtml-in" to check for the existence of
> an object. You should directly check for the object:
> 
>   I many cases, you can use
> 
>     <dtml-if "_.hasattr(aq_explicit,'attrname')">
> 
>   or
> 
>     <dtml-if "_.hasattr(object.aq_explicit,'attrname')">
> 
>   to check whether the current object or "object", respectively,
>   has attribute "attrname".
> 
> 
>   In some rare cases, this can give you a "true" result,
>   even though the object does not have an 'attrname'.

To help me understand Zope better (!), what are the 'rare cases' where
this would give a false positive?

Thanks for the help.


-- 
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington