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
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@gmx.de> To: <zope@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@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 )
Florian Reiser wrote at 2004-7-27 11:35 +0200:
... 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?
Yes, the latter... -- Dieter
participants (3)
-
David Hassalevris -
Dieter Maurer -
Florian Reiser