[Zope] How can you tell if what kind of object it is
Rik Hoekstra
hoekstra@fsw.leidenuniv.nl
Tue, 09 Nov 1999 22:04:47 +0100
> Is there something like _.isDTMLMethod, _.isDTMLDocument, _.isFolder
> hidden somewhere? I've been browsing the documentation but have not been
> able to figure this out. I need that to create a dynamic navigational
> bar that sshould get set like this:
>
> <dtml-call "REQUEST.set('fobs', [])"> <!-- Folders -->
> <dtml-call "REQUEST.set('dobs', [])"> <!-- Documents -->
> <!-- Fill Folders and Documents -->
> <dtml-in "PARENTS[0].objectValues()" skip_unauthorized>
> <dtml-let item="_.getitem('sequence-item', 0)">
> <dtml-unless "hasProperty('hidden') and hidden">
> <dtml-if "item.isFolder"> <!-- This is what I'm looking for!
> -->
> <dtml-call "fobs.insert(0, item)">
> <dtml-elif "item.isDTMLMethod">
try:
<dtml-elif "item.meta_type=='DTML Method'"> (not sure about the
underscore - look it up in the ZQR. The point is that the meta type
determines the type of the property)
<snip>
Rik