[Zope] Get all folder objects in a folder
   
    Roger Erens
     
    rerens@dela.org
       
    Wed, 3 Jul 2002 15:52:28 +0200
    
    
  
Hi Oliver,
could you try using a path expression
<div tal:define="folders here/list_folders">
or with python
<div tal:define="folders python: container.list_folders">
that is, without the parentheses?
Regards,
Roger
? -----Oorspronkelijk bericht-----
? Van: Oliver Marx [mailto:oliver@tekk.dk]
? Verzonden: woensdag 3 juli 2002 15:43
? Aan: Zope mailinglist
? Onderwerp: [Zope] Get all folder objects in a folder
? 
? 
? Hi
? 
? I have a little python script:
? 
? [PYTHON]
? 
? """
? Name list_folders
? Returns a list of folders.
? """
? 
? folders=container.objectValues('Folder')
? return folders
? 
? [/PYTHON]
? 
? I'm trying to call it from a ZPT
? 
? [ZPT]
? 
? <metal:block metal:define-macro="column">
? 
? <div tal:define="folders python:here.list_folders()">
? 
?   <table class="box" summary="Test" cellpadding="0" cellspacing="0">
?    <thead>
?         <tr><th>Navigation</th><th class="empty"> </th></tr>
?    </thead>
?     <tbody>
? 
?       <tr valign="top" tal:repeat="folder folders">
?         <td><a href="./Partners"
?                tal:attributes="href folder/absolute_url"
?                tal:content="folder/getId">Partners</a></td>
?       </tr>
?     </tbody>
? 
?   </table>
? </div>
? 
? </metal:block>
? 
? [/ZPT]
? 
? But it doesn't work. Zope complains about the call
? python:here.list_folders().
?