[Zope] arrays in sql methods and dtml-in

Ross J. Reedstrom reedstrm@wallace.ece.rice.edu
Wed, 24 Nov 1999 17:10:42 -0600


On Wed, Nov 24, 1999 at 01:42:52PM -0600, Dennis Moore wrote:
> I have a document with a checkbox group in it.  This group corresponds to
> an array in my Postgres database.  So, for example, the user does this:
> 
> Letters:
> [ ] A
> [x] B
> [ ] C
> [x] D
> 
> Then my dtml method gets: ['B', 'D']

O.K., try an ZSQL method with an argument: letters:list

and content like:

INSERT INTO foo (letters) VALUES (              
  <dtml-in letters>
     <dtml-if sequence-start>
       '{
     </dtml-if>
     "<dtml-var sequence-item>"
     <dtml-if sequence-end>
       }'
     </dtml-if>
  <dtml-else>
    null
  </dtml-in>
)

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