[Zope] test for an object's existence?

Chris McDonough chrism@digicool.com
Fri, 28 Apr 2000 18:47:40 -0400


<dtml if "_.hasattr(my, 'object')">
do something
</dtml-if>


> -----Original Message-----
> From: Kevin Howe [mailto:khowe@performance-net.com]
> Sent: Friday, April 28, 2000 6:12 PM
> To: ZOPE Mailing List
> Subject: [Zope] test for an object's existence?
> 
> 
> How do I check for an object's existence in the ZOPE tree?
> 
> I thought one of these would work:
> 
> <dtml-if "REQUEST.resolve_url('http://domain/my/object')">
>   Yes
> <dtml-else>
>   No
> </dtml-if>
> 
> OR
> 
> <dtml-if "my.object">
>   Yes
> <dtml-else>
>   No
> </dtml-if>
> 
> but they completely die rather than returning a false value.
> 
> Is there an "exists" method of some kind?
> 
> kh 
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>