If you want the combination of two fields a,b from table t to be unique then use:
db.t.b.requires = IS_NOT_IN_DB(db(db.t.a==request.vars.a),db.t.b)
If you want the combination of two fields a,b from table t to be unique then use:
db.t.b.requires = IS_NOT_IN_DB(db(db.t.a==request.vars.a),db.t.b)