[Zope] Python method for getting contents of a sub-folder

Florent Guillaume fg@nuxeo.com
21 Aug 2001 20:37:14 GMT


> Main_Folder
>   +-- Get_Contact_Info (Python method)
>   |
>   +-- First_Folder
>   |  +-- Contact_1 (DTML Document)
>   |
>   +-- Second_Folder
>      +-- index_html (DTML Method)
> 
> From index_html, I want to call the Get_Contact_Info method (through
> acqusition)
> and have it return the absolute_url and title of the object(s) in the first
> folder (e.g., Contact_1).

Something like:

l = []
for obj in container.First_Folder.objectValues():
  url = obj.absolute_url()
  title = obj.title
  l.append((url, title))
return l


Florent Guillaume
Nuxeo