[Zope] Get an object by name from a folder

Hung Jung Lu hungjunglu@hotmail.com
Thu, 03 Feb 2000 12:28:11 PST


Hi,

This has bugged me for a while. I know I can get ALL the items
in a folder by using objectValues() or objectIds(). But how
can I get an object in a folder quickly without having to
go through every single item?

I have an object named debug_dtml, it can appear in any folder
or subfolder. How do I check whether it exists? The
<dtml-with ... only> tag does not help much, because it does
not allow me to access other variables when I have to render
the debug_dtml method.

The _.hasattr() function is no good because it assumes
acquisition. I would like to disable acquisition for
this purpose.

What I would like are folder methods like:

    hasObject('object_id')
    getObject('object_id')

But apparently this is impossible without writing a
Python external method.

regards,

Hung Jung

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com