I see, thanks!

On Sat, Aug 10, 2013 at 1:39 PM, Massimo Di Pierro <
[email protected]> wrote:

> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/QABiqKdKmlg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to