Did you move that validator from the promoPositionID field to the nodeID
field? The second version of the validator is checking for unique values in
the nodeID field, not the promoPositionID field, so the validator belongs
on the nodeID field. If you want it on the promoPositionID field, then it
would have to be:
IS_NOT_IN_DB(db((db.PromoUnit.sequenceNumber==request.vars.sequenceNumber) &
(db.PromoUnit.nodeID==request.vars.nodeID)), db.PromoUnit.
promoPositionID,
error_message='combination nodeID promo position sequence number
already in database')
Anthony
On Tuesday, August 7, 2012 1:39:44 PM UTC-4, Annet wrote:
>
> Hi Anthony,
>
> Looks like it should work. What do you mean it doesn't work? What are you
>> expecting, and what is happening instead?
>
>
> In case I enter the following records:
>
> nodeID promoPositionID sequenceNumber
> 283 1 1
> 283 1 2
> 283 1 3
>
> the validator should prevent me from entering
>
> 283 1 2
>
> but it doens't.
>
>
> Kind regards,
>
> Annet
>
--