[Zope] Zope object Property name

Chris McDonough chrism@zope.com
13 Aug 2002 16:21:22 -0400


This should do the trick:

<dtml-in objectValues>
   <dtml-if "meta_type == 'Folder'">
      do something
   </dtml-if>
   <dtml-if "meta_type =='DTML Method'">
      do something else
   </dtml-if>
</dtml-in>

This is probably better expressed as a Python Script, but the above will
work...

Here's an example of a Python Script that returns a list of objects with
their types:

l = []
for value in context.objectValues():
    l.append({'id':value.getId(), 'type':value.meta_type})
return l

A DTML method to iterate over the result of this Python Script (if it
were named getStuff) might look like:

<dtml-in getStuff>
   <dtml-var id> <dtml-var type>
</dtml-in>

- C


On Tue, 2002-08-13 at 16:07, Jason Wertz wrote:
> I'm a new at this so please bear with me...
> 
> I'm using a dtml-in tag to iterate through a list returned by objectValues. I want to look at each item and determine if it is a folder or a dtml-file and execute a certain action based on that information. Only problem is, I don't know what property holds that info and I've looked all over. Can anybody help? 
> 
> Sorry if this is a dumb question but this is driving me nuts. 
> 
> Jason Wertz
> Senior Technology Specialist / WebMaster
> Delaware County Community College
> ph: 610-325-2771
> fax: 610-325-2820
> http://learn.dccc.edu/~jason
> 
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )