[Zope] question about searching on subobjects

Jake Berglund jwb@imeme.net
Mon, 07 May 2001 00:05:47 -0400


Hello,


 > i want to get some propertie from "itemX" if some propertie of "sub" 
equals
 > something.
 >
 > to make it more clear (propertis are enclosed in parenthesis)
 >
 > books
 > 	bookname1 (description)
 > 		review (author)
 > 	bookname2 (description)
 > 		review (author)
 > 	bookname3 (description)
 > 		review (author)
 > 	bookname4 (description)
 > 		review (author)
 >
 > i want to get the "description" of the book whose reviews's author is
 > "author" ? hu... clear ?


You can use nested dtml-ins to iterate over your objects, then dtml-var
to display their properties.

for example:
<dtml-in expr="objectValues(['Folder'])">
   <dtml-var name="description">
   <dtml-in expr="objectValues(['Folder'])">
    <dtml-var name="author">
   </dtml-in>
</dtml-in>

Hope that helps,
Jake
-- 
Jake Berglund <jwb@imeme.net> Online Community Building
http://imeme.net - Affordable Zope Webhosting