Python method for getting contents of a sub-folder
I want to (or simply think I should) use a python method to get information about an instance of one object in a first sub-folder from a DTML Method in a another sub-folder. Graphically put, 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).
The question I have is what little trick do I need to include in the Get_Contact_Info method to obtain the correct set of ObjectValues of the objects in the First_Folder? The nice thing about this methodology is that I don't have to worry how far down the branches of the tree I am to get basic information from the "base" folder. I simply use acqisition to call the method. TIA, Ron
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
participants (2)
-
complaw@hal-pc.org -
Florent Guillaume