#to check to see if id exists in current folder: myId = 'id to check for' #in Script(Python) this will check current folder, #as well as Acquired objects if hasattr(context, myId): return getattr(context, myId) #another way is to use the default argument of getattr return getattr(context, myId, 0) #in a DTML Method you can exists doesnt exist #or exists nope #or simply in objectIds() not in objectIds() #in a DTML Document exists doesnt exist #using objectIds in objectIds() not in objectIds() #in PageTemplates, NOTE: you are returning the *actual* instance # EXPLICIT: # getattr/hasattr checks acquistion, if you want to explictly # check a folder if it has a object you .aq_explicit # Script(Python) f = context.myFolder if getattr(f.aq_explicit, myId, 0): return myId + ' exists!' #DTML exists doesnt exist #if you want to check the parent folder you can, go up the acqusition #chain using aq_parent f = context.myFolder if getattr(f.aq_parent.aq_explicit, myId, 0): return 'exists' return 'nope' #this will check explicitly myFolder's parent directory for myId #we can also use ZDOM f = context.myFolder if getattr(f.getParentNode().aq_explicit, myId, 0): return 'exists' return 'nope' #if you want to programatically acquire lets say, a Property from the Acquistion #chain you can use propertyValue=object.aq_acquire('propertyId')