Jim Vine wrote:
> How does one go about generating
> a search form that accepts a few criteria, and has a
> "submit" button, that would then go off and fetches
> the results?

Another way of doing this rather than manually building the form, submitting 
and fetching them using self.request.get() could be defining a schema interface 
for your
search filter page (the interface containing your search filter attributes). 
You do not define it
as a content type as you search page is not a persistent object. Then in your 
you register it as an addform something like:

   schema=<your search filter interface>
   class=<Add View class where you perform your search>

In your view class I think you override AddView class update() method where 
you do 

data = getWidgetsData(self, <search form interface>)

your form fields should be available in the data dictionary.

Not sure if this would be the recommended way of collecting non-persistent form 
input but 
I feel that just by handcoding form html and fetching input using 
self.request.get you lose
some of the nice things of zope3 like automatic form generation and validation 
which I think
you would want to use even for non-persistent input like search forms. I 
haven't had a look
at the upcoming formlib but maybe it makes this sort of stuff even easier.


Zope3-users mailing list

Reply via email to