[Zope] Object Acquisition

Samir Mishra SamirMishra@cbuae.gov.ae
Wed, 26 Feb 2003 14:09:37 +0400


Sorry to be a bother, seems trivial, just can't seem to find the right
syntax for it...

How do I check if a particular object exists ONLY in the current folder (the
context) and is not being acquired? 

The script I have is - 

==================================

"""
Add single folder along with manager/user programmatically to current folder
Parameter: folderList (a list)
"""

curFolder = context #current context, where the user is

folderName = folderList[0]
folderTitle = folderList[1]

if not hasattr(curFolder, folderName):
    ## create the folder
    curFolder.manage_addFolder(folderName, folderTitle, 0, 1)
    return 1
else:
    return 0

==================================

Unfortunately, if FolderName exists in the parent (or above) folder, the
script will return 0. I only want to look in the context folder for the
existence of folerName.

Thanks again.

Samir.