On Monday, February 20, 2012 3:31:29 PM UTC-5, Alan Etkin wrote:
>
> Great! Thanks for your quick answer. I really don't understand 
> completely what does IS_NOT_IN_DB, I just copy/pasted the code and it 
> works perfectly. I'll check the documentation and the API for detailed 
> info.
>

The first argument is either a db object or a Set (i.e., a db object called 
with a query), and the second is a particular table.field to check for 
duplicate values within the specified db or Set. So, in:

IS_NOT_IN_DB(db(db.combinada.segundo==request.vars.segundo),
    "combinada.primero")

it is finding the set of records identified by db(db.combinada.
segundo==request.vars.segundo), and within that set of records, it is 
checking whether the submitted value is duplicated within the 
combinada.primero field.

Anthony

Reply via email to