[Zope] Combing 2 list
David Hassalevris
bluepaul@earthlink.net
Tue Aug 5 07:28:37 EDT 2003
Yes do that in your SQL. Its not a Zope problem.
David
----- Original Message -----
From: "Chan YH" <cyhoong@pc.jaring.my>
To: <zope@zope.org>
Sent: Monday, August 04, 2003 10:38 PM
Subject: [Zope] Combing 2 list
> 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 )
More information about the Zope
mailing list