do that in SQL and query that view hth On Tuesday 05 August 2003 01:38 pm, Chan YH wrote:
I would like to combine 2 sql tables into one using dtml/python script method. Person (table) + Company (table) => Contact (table)
Can someone give a me a tip?
Thank a lot.
Data Entry Form ============ <dtml-var standard_html_header> <h2><dtml-var title_or_id></h2> <form method="post" action="form1_action" enctype="multipart/data"> <table> <dtml-in listPerson_sql> <tr> <td>Name:</td><td><dtml-var first_name> <dtml-var last_name></td> <td><select name="co_name" value=""> <dtml-in listCompany_sql> <option value="&dtml-co_name;">&dtml-co_name;</option> </dtml-in listCompany> </select> </td> </tr> </dtml-in listPerson> <tr> <td><input type="submit" value="Submit" name="submit" /></td> </tr> </table> </form> <dtml-var standard_html_footer>
Form1_action method - this method doesn't do anything =============== ??? <table> <dtml-in listPerson_sql> <dtml-in "REQUEST.co_name"> <tr><td> sequence-item is: </td><td><dtml-var sequence-item></td></tr> <tr><td> name is: </td><td><dtml-var first_name><dtml-var last_name></td></tr> <tr><td><br /></td></tr> </dtml-in REQUEST.co_name> </dtml-in listPerson> </table>
SQL method ========= listCompany_sql: select * from company
listPerson_sql select * from person
Table schema -------------- CREATE TABLE person ( first_name char(20), last_name char(20) );
CREATE TABLE company ( co_name char(20), co_phone char(20) );
CREATE TABLE contact ( first_name char(20), last_name char(20), co_name char(20), co_phone char(20) );
_______________________________________________ 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 )