[Zope] Need help with ':records' form construct
Paz
paz@chello.nl
Sun, 15 Apr 2001 12:25:14 +0200
Somewhere there is some decent documentation but I dont have that ref handy
at the moment. The way I understand the records to work is this:
In the form, your input tages need to be as so:
<input type="text" name="item.a:records:required">
- required bit is superfluous.
In the the dtml, you need to call the ZSQL method....
<dtml-if "REQUEST.has_key('Submit')">
<dtml-call submitFormZSQLMethod>
</dtml-if>
- note there are no parameters passed through this... It doesnt seem to work
if you do that... I've tried with no success.
In the submitFormZSQLMethod...
The parameters passed in are : item:records
then the ZSQL method:
<dtml-in item>
insert into table yaddayadda (a, b, c) values (
<dtml-sqlvar a type=string>,
<dtml-sqlvar b type=string>,
<dtml-sqlvar c type=string> )
<dtml-var sql_delimiter>
</dtml-in>
- you are naming all inputs as an class called 'item', and specifiying that
they are 'records'. You need the dtml-in because 'records' implies of course
more than one, so the REQUEST will show item.a = something item.b =
something else and so on
- I dont know if you can do this from a Filemaker form because I don't see
how the item iteration would work into the Zope namespace... .but Im not the
one top ask about that. ... I;m only showing what I know, which aint that
much...
Paz
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris
Beaumont
Sent: Sunday, April 15, 2001 10:49 AM
To: zope@zope.org
Subject: [Zope] Need help with ':records' form construct
Hello,
I'm hoping that one of you can help me out with the
not-very-well-documented ' :records ' form construct.
I have a long form which contains information from around 100
separate database records..
This is being sent into Zope from a FileMaker form.. Its displayed in
a long Zope form (it displays properly...) and edited.. and then I'm
hoping to submit it from Zope and use the information to populate a
SQL database via a ZSQL method.. I've tried two different ways to get
it into my database, both iterating through the results and calling
the SQL method on each iteration, and also doing my dtml-in in the
ZSQL method itself. Neither have worked..
The ZSQL documentation doesn't give much to go on.... so I'm hoping
some of you can give me some pointers.. The data is mixed strings and
integer data, but that shouldnt be a problem.. When I point the forms
action at a method with simply <dtml-var REQUEST> in it, I see that
it appears that the data is being concatenated together.. Is this
what is supposed to be happening?
Any ideas or suggestions on how to make this work are welcome..
-Chris
This is the first part of the form and then the <dtml-var REQUEST> output..
___cut here________
<input type="hidden" NAME="sqlinput.PERS_FMPID:records"
value="&dtml-PERS_FMPID;">
<TR><TD ALIGN="RIGHT">Last Name</TD><TD><INPUT TYPE="TEXT"
NAME="sqlinput.PERS_LNAME:records"
value="&dtml-PERS_LNAME;"></TD></TR>
<TR><TD ALIGN="RIGHT">First Name</TD><TD><INPUT TYPE="TEXT"
NAME="sqlinput.PERS_FNAME:records"
value="&dtml-PERS_FNAME;"></TD></TR>
<TR><TD ALIGN="RIGHT">Person Type</TD><TD>
submit Process
sqlinput [PERS_AFFILIATION: , PERS_ARRIVALDATE: , PERS_DEPARTDATE: ,
PERS_EMAIL: alperin, PERS_FMPID: 33133, PERS_FNAME: Roger,
PERS_LNAME: Alperin, PERS_OFFICE: , PERS_TYPE: gm, PERS_AFFILIATION:
, PERS_ARRIVALDATE: , PERS_DEPARTDATE: , PERS_EMAIL: andersen,
PERS_FMPID: 33179, PERS_FNAME: Jorgen, PERS_LNAME: Andersen, P
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )