[Zope] File objects

Dirk Datzert dirk.datzert@rasselstein-hoesch.de
Sat, 01 Jun 2002 12:38:13 +0200


mediaweb@linfe.it schrieb:
> 
> From Dirk Datzert, Sat Jun 01, at 10:47:
>  .sure that you have to used a dtml-method (not a dtml-document)?
> 
> Yes, it is a dtml method
> If i replace 'File' with 'Folder' in my code, i properly get the list of folders
> 

try:

   <dtml-in "aq_parent.objectValues('File')">
           <li><dtml-var id></li>
   </dtml-in>

if you now get the result you expect than once again:
you have a dtml-document instead of a dtml-method ?

> 
>  .sure that you have meta_types = 'File' (not 'ExtFile' or 'EasyFile') in
>  .your folder ?
> 
> i added a 'File' from the ADD pull down, just to make me sure; that file
> is not displayed even
> 
> Is there a code to list all the objects contained in a folder?

As the definition of objectValues in lib/python/OFS/ObjectManager.py
says

    def objectValues(self, spec=None):
        # Returns a list of actual subobjects of the current object.
        # If 'spec' is specified, returns only objects whose meta_type
        # match 'spec'.
        return map(self._getOb, self.objectIds(spec))

you can leave out spec ('File' in your example) and do the following:

   <dtml-in "objectValues()">
           <li><dtml-var id></li>
   </dtml-in>

> 
> thank you
> 
> --
> max