IS_NOT_IN_DB does take a DAL Set object as the first argument, so you can limit the records checked to a particular set within the table (see http://web2py.com/book/default/chapter/07#Database-Validators). However, I'm not quite sure what you're trying to do here.
On Thursday, June 30, 2011 4:27:56 PM UTC-4, Richard wrote: > Hello, > > Is it possible to declare UNIQUE constraint over many fields and how... > > Does using IS_NOT_IN_DB() on the differents fields will work? > > > ...num_part1.requires=IS_NOT_IN_DB(db((db.ref_fnaregistry.num_part1==request.vars.num_part1) > > & > (db.ref_fnaregistry.num_part2==request.vars.num_part2) & > (db.ref_fnaregistry.num_part3==request.vars.num_part3) & > > (db.ref_fnaregistry.title==request.vars.title)),db.ref_fnaregistry.num_part1) > > etc. > > But I think i need to concatenate... > > If there is no way I think I know how I will do it. > > Richard >

