[Zope] Referencing Objects from id's stored in a lines property.

complaw@hal-pc.org complaw@hal-pc.org
Thu, 16 Aug 2001 22:55:19 GMT


I'm considering using a DTML document having a lines property that stores id's
of related objects (i.e., objects where there is to be a user-defined
relation).  Essentially, the lines property would be a container of id's of
objects available to the object having the lines container.  

I can load the id's into the lines property (that is easy).  However, does
anyone know of the DTML code needed to sequentially list each of the elements in
the lines property (which is a Python list) and then call that object to obtain
and then display the title corresponding to the object id?

The following some pseudo-Python, I make no pretense that this is syntactically
correct DTML.  It's not pretty, but I think it illustrates what I'm looking
for.  Note, there is a DTML document with a lines property called
"my_related_objects"


<dtml-in my_related_objects>

  # Get the item at this point in the list (lines)...
  <dtml-var my_related_objeccts[item]> 
  
  # call that object and get its title and absoluteURL and list as a hyperlink.
     <A HREF="<dtml-var my_related_objects[item]>"><dtml-var
my_related_objects[item].title></A>

</dtml-in>


Is something like that possible?  Is there a better way of doing it?

TIA,

Ron