[Zope] sql results in "in" clause

David Hassalevris bluepaul at earthlink.net
Tue Jul 27 16:17:18 EDT 2004


Hi Florian,
This should not be difficult.  I would add additional fields to your
external table.  Like "Phone" or "Fax", etc.
That way you can associate objects in the HTML form (they have names) with
fields in your DB.

If you want to populate a form with default values from an external DB you
can:

1) write the zSQL script
2) In, say, the dtml script that contains the form do stuff like:


<dtml-in yourZsql>
<dtml-if "form == document_id">  <---- thats the "key" to your defaults
table
<dtml-let> UserPhone = Phone  <--- phone is a field in your defaults table
<form ...>
<input type="hidden" name="cr_number"
       value="<dtml-var UserPhone missing="">">  <-- theres the magic
.
.
</form>
<dtml-let>
Hope that helps,
David


----- Original Message ----- 
From: "Florian Reiser" <florian_reiser at gmx.de>
To: <zope at zope.org>
Sent: Tuesday, July 27, 2004 2:35 AM
Subject: [Zope] sql results in "in" clause


> Hello zopistas,
>
> I want to store a selection list in a database table with the following
> structure.
>
> user | form | value
> -----+------+-------
>      |      |
>      |      |
>      |      |
>      |      |
>
> If the user enters the form again the stored selection list, is loaded
from
> the db again with an sql on user and form.
> Could I then use an "if value in resultSet.value:" to check, if the value
> was checked when the user stored the form? Or do I first have to extract
the
> value column in a list and then check against this list?
>
> Regards
>
> Florian Reiser
>
> -- 
> NEU: WLAN-Router für 0,- EUR* - auch für DSL-Wechsler!
> GMX DSL = supergünstig & kabellos http://www.gmx.net/de/go/dsl
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )



More information about the Zope mailing list