Thanks for your help, I looked at the book and it says : The first argument of IS_NOT_IN_DB can be a database connection or a Set. > In the latter case, you would be checking only the set defined by the Set. >
I did not know that it could be a sSET too Thanks again. On Tue, May 8, 2012 at 12:56 PM, Anthony <[email protected]> wrote: > > > On Tuesday, May 8, 2012 6:48:34 AM UTC-4, Khalil KHAMLICHI wrote: >> >> I generate a drop down menu with this line of code >>> >>> db.files.project.requires = IS_IN_DB(db, 'projects.id', '%(project)s', >>> zero='...') >> >> >> how do I add a filter like : (db.projects.deleted==False) to filter out >> the records displayed by the drop down menu ? >> > > IS_IN_DB(db(db.projects.deleted==False), 'projects.id', '%(project)s',zero > ='...') > > IS_IN_DB takes a DAL Set object as the first argument, which can be used > to filter the set of records used to create the list. See > http://web2py.com/books/default/chapter/29/7#Database-validators. > > Anthony >

