[Zope] - Help with Zope project
David Wagle
david.a.wagle@HealthPartners.Com
Wed, 30 Dec 1998 15:31:59 -0600
Ok - first please reply to all for this message. While I have
sent a subsribe to the list, I have yet to receive any mail
from it, so I'm not certain that it is working for me yet.
Now, I've got Zope and the ZMySQLDA stuff installed on my Linux
box, and it is working just fine. I can connect to the database,
and I can insert values and do selects. Now I'm trying to get
a little tricky, and after pouring over the documentation, I
realize I have no idea what I'm doing. . . .
So maybe someone here can point me in the right direction.
I have a database connection on the top of my hierarchy.
I have several folders under the hierarchy in which I want
to be able to manipulate different parts of the database.
A simplified database scheme looks like this:
user_table (
id int auto_increment,
l_name char(30) not null
)
data_table (
id int auto_increment primary key,
name char(30) not null,
submitter int references user_table(id))
data_table2 (
id int auto_increment primary key,
keyword char(30) not null,
d_id int references data_table (id),
u_id int references user_table (id))
Now, I have a ZMysql method that takes as an argument the lastname,
and returns the user id.
I want to have a method for inserting into the data_table that does
uses this value:
ie, it should look like this:
Last Name ************
Name ***************************
Keywords ****************************
and populate both the data_table, including the submitter id,
and the data_table2.
So my questions are:
a) how do I get the sql_method that I am using to look up the
id# for the user based on the LastName and insert that value
into the data_table?
I have something like this:
Arguments L_Name:string:required name:string:required
keywords:tokens
INSERT INTO data_talbe values (
"",
'<!--#sqlvar name fmt=sql-quote-->',
???????????????????
what do I put in the ?????????????? to make it work?
b) then I have an sql_delimeter line, and I want to iterate through the
keywords tokens and insert a record into the data_table2 for each
of the keywords, including the submitter id# and the id# of the just
inserted record from data_table. How do I do this??
Thanks for the help. I realize that this is probably pretty basic to
some
of you folks, but I am really struggling with this and finally decided
to come begging for help.
If you need more info, please ask.
Dave