try with "validate_and_insert" instead of "insert" . 
Of course the first time the eventid is not there yet, but the second time 
you try to insert a row with the same eventid, sqlite informs you that he 
can't cause the column is bound to have unique values.
You did it all right, but you failed to consider only that insert() "skips" 
the validators, so your IS_NOT_IN_DB() doesn't get triggered (ps: a unique 
field has a IS_NOT_IN_DB attached by default, you can skip your explicit 
declaration).
With validate_and_insert() though, every row you'll try to insert will try 
if that passes validation before actually inserting it.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to