>From an old thread, Massimo answered:

<quote>

Validators are associated to one field in the sense that only one
field will report the error.

db.define_table('t',SQLField('f1'),SQLField('f'2'))
db.t.f2.requires=IS_NOT_IN_DB(db(db.t.f1==request.vars.f1),'t.f2')
 OR
db.t.f1.requires=IS_NOT_IN_DB(db(db.t.f2==request.vars.f2),'t.f1')

are equivalent and do exactly what you ask.  except that the former
associates the error with the f1 value and the second to the f2 value.
They both generate the query

db((db.t.f1==request.vars.f1)&(db.t.f2==request.vars.f2)).count()

</quote>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to