tags:

views:

306

answers:

2

Do I need a custom validator? Do I need a custom widget?

If this helps to clear the problem, the relationship is between member and language where a member can have multiple languages and a language is spoken by multiple members.

I would like to add a multi-select box in the "add member" form (that I generate using SQLFORM).

Thanks :)

+1  A: 

It depends and I suggest you take this on the web2py mailin list. One way to do it is

db.table.field.requires=IS_IN_DB(db,'othertable.id','%(otherfield)',multiple=True)
mdipierro
A: 

Another way to do this:

db.define_table( 'make', Field( 'name' ) )

db.define_table( 'model', 
    Field( 'name' ), 
    Field( 'make', db.make, requires = IS_IN_DB( db, 'make.id', '%(name)' ) ) )
Ryan Montgomery