Thanks Massimo! Works great now.

I'm really liking web2py. It's very productive, your time is primarily
spent on design instead of coding which is how it should be.

On Oct 6, 10:02 am, mdipierro <[email protected]> wrote:
> Instead of this:
>
> form = SQLFORM(db.syntable)
> form.vars.phrase = word
> #form.vars.syns = '|'+'|'.join(wordlist)+'|'
> form.vars.syns = wordlist
> if form.accepts(request.vars, session):
>     redirect(URL('test',args=myid))
>
> do
>
> db.syntable.phrase.default = word
> db.syntable.syns.default = wordlist
> form = SQLFORM(db.syntable)
> if form.accepts(request.vars, session):
>     redirect(URL('test',args=myid))
>
> There should be no '|' in your code.
> On Oct 6, 8:54 am, Chuck Paulson <[email protected]> wrote:
>
>
>
> > I am new to web2py and am writing my first app. I would like to pre-
> > populate an SQLFORM field of type list:string with a list of strings
> > and then display the form. The problem is that the syns always
> > displays a one text box with a string that is either values separated
> > by '|' or values or a string representation of a list.
>
> > However, if I display a row already in the database with
> > crud.update(), the list:string field is represented by a list of text
> > fields, one per value, which is what I want. Is there a way to pre-
> > populate the list:string field so it shows a list of text fields, one
> > per value? Thanks,
>
> > Chuck Paulson
>
> > db.define_table('syntable',
> > Field('phrase', 'string'),
> > Field('syns', 'list:string'))
>
> > form = SQLFORM(db.syntable)
> > form.vars.phrase = word
> > #form.vars.syns = '|'+'|'.join(wordlist)+'|'
> > form.vars.syns = wordlist
> > if form.accepts(request.vars, session):
> >     redirect(URL('test',args=myid))- Hide quoted text -
>
> - Show quoted text -

Reply via email to