[Zope-DB] How can I dynamically generate a Z Search Interface?
Thu, 5 Sep 2002 11:31:48 -0700
Many thanks for your response and advice. It finally registered
in my brains. I can also see that it is dangerous to use Z SQL
method in this fashion. I am interested in pursuing a use of
External Method. Would you have any comments/advice for
<dieter@handshake To: "Tena Sakai" <email@example.com>
.de> cc: firstname.lastname@example.org
Sent by: Subject: Re: [Zope-DB] How can I dynamically generate a Z Search
Tena Sakai writes:
> 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?
You have a (static) Z SQL method that accepts "this very data"
as parameters and build the corresponding SQL command.
One way would be:
Z SQL Method:
Body: <dtml-var SQLCommand>
Thus, you pass in the complete SQLCommand (which you constructed
out of your data, as it fits your needs).
Of cause, this method is dangerous:
When you are not careful, it could be called with "delete from XXXX"
and your table "XXXX" would be empty.
Therefore, I would try to avoid such a general method.
I would probably use:
Z SQL Method:
Body: Build the SQL command from *KeyWordArgs*
I would call it in the following way.
Zope-DB mailing list