Folders behave like python dictionaries, so you can use that lookup syntax in a python expression such as: tal:define="docs python:here.county[request.county].objectValues()" You should know that this will not scale very well though. If there are more than a few dozen documents in each county, performance may not be very good. This is because objectValues looks up every object in the folder individually. If this becomes a problem, then you can use ZCatalog with a "county" index. hth, -Casey On Monday 29 April 2002 06:13 pm, Ronald L Roeber allegedly wrote:
I am trying to generate an form option list containing documents in a folder. The folder arrangement is as follows.
county -- Golden --- doc1 | | | -- doc2 | - Silver --- doc3 | -- doc4
If the user has indicated they are from "Golden" county, how do I generate the proper list of documents in the corresponding directory dynamically ['doc1','doc2']? If the REQUEST object includes the county=="Golden", how can I do something like this (which works, but is obviously not dynamic):
<form="form" method="post" action="action" tal:define="workingCounty request/county; docs here/county/Golden/objectValues()">
How do I get the workingCounty variable to replace the "Golden" in the docs definition. This is probably simple, but I'm missing it. Thanks for any help.
-------------------------------------------------------------------- Ronald L. Roeber CIT-IANR University of Nebraska Lincoln, NE 68583 Phone: (402) 472-5630 email: rroeber1@unl.edu
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )