Storing a reference to a page within a python variable.
Hi all, I want to be able to store references to different pages within a dictionary in python. I know how to store the actual page(by calling it and assigning the results), but sometimes that page depends on variables that might change a few times during the course of that pages life as a dictionary value. I'm sure there is a way to do this, and I haven't figured it out yet. As an added bonus, is it possible for this reference to be useful from within python and using TAL? Thanks very much, Alec Munro
Alec Munro wrote:
Hi all,
I want to be able to store references to different pages within a dictionary in python. I know how to store the actual page(by calling it and assigning the results), but sometimes that page depends on variables that might change a few times during the course of that pages life as a dictionary value. I'm sure there is a way to do this, and I haven't figured it out yet. As an added bonus, is it possible for this reference to be useful from within python and using TAL?
Thanks very much, Alec Munro
Use the path to the object as the unique identifier and store it in a string or a list of string, i.e. obj_list = ['/your/document','/another/document'] or obj_list = [['your','document'],['another','document']] Use restrictedTraverse() to get the object from the path and getPhysicalPath() to get the path from a given object. IIRC, one of the needs the first variation of obj_list, the other one the second, so you'll need to convert. cheers, oliver
participants (2)
-
Alec Munro -
Oliver Bleutgen