[Zope] SQL Methods - tokens or list parameters

Ross J. Reedstrom reedstrm@rice.edu
Tue, 02 Feb 1999 18:07:36 -0600


Jim Fulton wrote:

<can't reproduce my problem>

> > in add_person_form:
> >
> > <... rest of form/table deleted>
> > <tr><td>PerDegree</td><td><input type=text name=PerDegree></td></tr>
> 
> Where is ':tokens'?

In the parameters list to the SQL-Method. That seems to do it for the
space containing case. I didn't persue this any farther, since the
natural seperator for degrees is a comma, and I got the list case
working. I think it's a case of my being a python newbie as well as a
zope newbie (and a sql newbie, and an HTML newbie, and ... Hey, I know
Tcl, does that count? ;-)

Here's what I did for the list:

add_person_form send string to add_person_action, which contains:

<!--#call "add_per_degree(PerID=PerID, 
PerDegree=_.string.split(PerDegree,','), 
ConferringInstitution=ConferringInstitution, DegreeDate=DegreeDate)"-->

and add_per_degree is:

Aguments: PerID:int PerDegree:list ...

<!--#in PerDegree --> 
...

This may seem an unnatural way to do things. I have that familiar itch
that I'm not quite groking something here - It's the Zope Zen, probably.
Need that flash of enlightenment. Ahh! Minor flash - the name:type
syntax applies to form inputs as well, doesn't it? I can make my
original form like:

<tr><td>PerDegree</td><td><input type=text
name=PerDegree:list></td></tr>

then remove the string.split from add_person_action or some such?

Thanks,

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005