what about query = ( db.person.id == db.othertable.id ) & xxx xxx.requires = IS_IN_DB(db(query),'othertable.id',((( all fields of othertable are accessible, no need for dot ))), xxx )
Ashraf On Feb 22, 9:42 am, Bruno Rocha <rochacbr...@gmail.com> wrote: > On Tue, Feb 21, 2012 at 8:22 PM, Richard Vézina <ml.richard.vez...@gmail.com > > > wrote: > > db.dog.owner.requires = IS_IN_DB(db,db.person.id, db.person(db.person.id > > ).name) > > > Then if that is possible, why not : > > > db.dog.owner.requires = IS_IN_DB(db,db.person.id,'%s' % db.person( > > db.person.id).name db.othertable(db.person(db.person.id > > ).fk_to_other_table_id).field_other_table) > > Not possible, but this is possible: > > db.dog.owner.requires = IS_IN_DB(db, db.person.id, *lambda row: > db(db.othertable.foreign_key == row.reference_key > ).select().first().somefield*) > > -- > > Bruno Rocha > [http://rochacbruno.com.br]