[Zope] Get all folder objects in a folder
Oliver Marx
oliver@tekk.dk
Wed, 3 Jul 2002 15:43:07 +0200
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().
What are my eyes missing or what do my brain not understand?
Thanks for your time :)
\Oliver
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 13-06-2002