[Zope] Test if an object exists in a folder

Max M maxm@mxm.dk
Wed, 31 Jul 2002 15:05:33 +0200


Hans Sandsdalen wrote:

>I'm new to zope, and I can't figure out how to check if an object (with
>a spesific name) exists in the current folder.
>

It kind of depends on where you want to check from. dtml, Python Script, 
Python product/external method or what have you.

dtml:
<dtml-if someObj>
    <dtml-var showStuff>
</dtml-if>

Python:
if self.someFolder.has_key('someObj'):
    showStuff()

regards Max M

-- 

"Sorry I would Really Like To Help More On This Project,
But Am To Busy Doing Paid Work On A Tight Deadline"
    Max M