I'm trying to make an ajax-ed multi-select widget, but I'm having a
brain fart and need some help. My model is something like this:

#model
db.define_table('member',Field('groups','list:string'))
db.define_table('group',Field('name'))

#controller
...
db.member.groups.requires=IS_IN_DB(db,'group.id','%(name)s')
form=SQLFORM.factory(db.member)
...
return dict(form=form)

#view
I want to be able to do something like
{{=form.custom.widget.groups}}

but I want the current member's group assignments to show as pre-set
(already selected) in the multi-select widget. So if all groups are
['a','b','c','d'] and the member group list is ['a','d'] then I expect
a multi-select widget with all options listed but a & d selected.

For some reason (fatigue?) I'm having trouble finding the syntax I
need to accomplish this. Any help out there?

Reply via email to