If it does not raise an exception it is successfull. The issue is that 
unless you are in a controller action you have to db.commit() or the insert 
will be un-committed.

On Saturday, 10 August 2013 17:07:17 UTC+2, Jordan Ladora wrote:
>
> Hi,
>
> I'm unable to figure out how to check when a simple db insert() was 
> successful. In my code below, regardless of whether the db insert is 
> successful or not, the code after 'if new_record:' always executes..
>
>
> new_record = db.abc.insert(a='this', b='that', c='theotherthing')
>
>     if new_record:
>
>
>
> How can I code "if db insert was successful:" ?
>
> Thanks,
> -J
>

-- 

--- 
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