I'm using SQLFORM.factory to create a multi-list from a list:string
field:
form=SQLFORM.factory(db.mytable)
where
db.define_table('mytable',Field('groups','list:string'))
The view is:
form.custom.widget.groups
The multilist widget appears in the view -- no problems there. The
issue is that I want to update the results stored in db.mytable[row]
and I want the multi-list to show the items currently stored in the
list:string array as being selected (highlighted) in the widget.
Question is, what is the most elegant way to do this. I know I can
pick apart the multi-list and do it all manually, but I figure web2py
has got to have a way to do this automatically ... just how? I would
love to do something like this:
form=SQLFORM.factory(db.mytable[row])
but that obviously doesn't work.