[Zope-dev] exec in zope?

Dan L. Pierson dan@sol.control.com
Tue, 23 May 2000 14:07:54 -0400 (EDT)


R. David Murray writes:
 > On Tue, 23 May 2000, Andrew Edmondson wrote:
 > > The following doesn't work, but it illustrates my idea:
 > > 	<dtml-in "Catalog(_.getitem(search_in)   =   _.getitem(search_for))">
...snip...
 > On the other hand, if you call the catalog via just
 > 
 > <dtml-in Catalog>
 > 
 > it will pull its search fields out of the REQUEST variable.  If you
 > can arrange it so that REQUEST contains just the appropriate search
 > variables set to the appropriate search values, you should be home free.

Or you can search the Catalog like this:

  <dtml-in "Catalog.searchResults({'category':category_id,
                                   'item_type':'book'})">

I.E. put all the search parameters in a dictionary and pass that
instead of REQUEST.  I use this instead of REQUEST because it's too
easy for REQUEST to get polluted with other variables whose names are
search fields.