[Zope] Re: has a folder the 'thumb.jpg' item?

Maik Jablonski maik.jablonski@uni-bielefeld.de
Thu, 16 Jan 2003 15:08:11 +0100


Catonano wrote:

> How do I check wether a folder contains a given file? i tried 
> "folder_item['thumb.jpg']" but when it reaches a folder that doesn't 
> contain a 'thumb.jpg' file it breaks! I tried has_key('thumb.jpg'), 
> hasKey('thumb.jpg') with no success!

Hi,

try:

_.hasattr(yourFolderToTestAsAnObject, 'thumb.jpg')

If you use this in a PythonScript, remove the '_.'

Cheers, maik