[Zope-DB] How can I dynamically generate a Z Search Interface?

Tena Sakai tena.sakai.b@bayer.com
Tue, 3 Sep 2002 09:49:13 -0700

Dear Dieter,

Thanks again for your reply.  I am afraid your brief explantion
is not getting through my thick skull.

      >> I think you know what I want, but let me be precise.
      >> I have a page that has a form.  The form is made of a
      >> bunch of checkboxes and next to each box there is a
      >> mentioning of a column name of a table.  A user checks
      >> or unchecks each box to his/her liking and presses the
      >> submit button.  The submit button invokes an action
      >> (a dtml method I wrote) which outputs a SQL statement
      >> (something like SELECT FOO, MAN, CHU FROM MYTABLE).
 > Apparently, you do not want to create a Z SQL Method
 > inside the ZODB but at most a temporary one.
 > Then, Z Search Interface cannot use it.

 > But, it is not necessary.

 >  You can use a single report that presents all of your
 >  results.

 >   The key is the "names" method of Z SQL Method results.
 >   It returns the sequence of column names in the result sequence.
 >   You use a 2 level loop, to make your report DTML object.
I know that much.  That is how I can generate
the form to begin with in the first place (and
the query statement, something like

My question is what would I do after that?  An answer
might be to invoke an external method passing the
column names I collected from the form.  I am sure
this is a solution which will work.  I just feel
there must be some other means to achieve what I
want without invoking an external method.

Let me reinstate the problem concisely.  I have a
dtml method which gives a form.  When user checks
or unchecks checkboxes and press submit button,
an action (which is also a dtml method) is invoked.
That action collects data (column names of a table)
dynamically.  How would I do actuall database
query using this very data?

I would appreciate it if you (or anybody esle!) would
tell me what framework/means I would employ/deploy.


Tena Sakai