Book states:
Code in models, views and controllers is enclosed in web2py code that
looks like this:
try:
execute models, controller function and view
except:
rollback all connections
log the traceback
send a ticket to the visitor
else:
commit all connections
save cookies, sessions and return the page
If the db update failed in the regular controller I would assume that
a ticket page would appear. But what if the db update is in a callback
function?
@Anthony, it seems that a db update failure would cause the rest of
the callback code to be not executed and so the flash='failure'
message won't appear at all.
On Sep 12, 3:19 pm, Anthony <[email protected]> wrote:
>
> .update() should return the number of rows updated, so maybe just:
>
> if db(db.tbl.id==100).update(data='sampledata'):
> flash='success'
> else:
> flash='failure'
>
> Anthony