[web2py] Re: Representing field in IS_IN_DB

2017-06-27 Thread David Orme
That's great. Thanks - I simply hadn't thought that I could switch which table the IS_IN_DB 'table.value_field' argument was pointing to in order to shift which fields were available. To give the specific answer for my case: db.datasets.project_id.requires = IS_IN_DB(query,

[web2py] Re: Representing field in IS_IN_DB

2017-06-27 Thread 黄祥
i think there are two solutions for this 1. either you set the format in every table definition and use the requires IS_IN_DB(query, db.table.id, table._format) 2. you keep your table definition and fixed the requires IS_IN_DB(query, db.table.id, '%s %s' % (id, title) ) ref: