On Thursday, November 24, 2011 9:27:06 PM UTC-5, Jose wrote:
>
> def test():
>
> form = SQLFORM(tb_1, 1)
> if form.accepts(request.vars, session):
> try:
> tb_2.insert(field1='test', field2='1xbx123')
>
> except:
> db.rollback()
> redirect(URL('error'))
> redirect(URL('test'))
> elif form.errors:
> response.flash = 'errors'
> return dict(form=form)
>
> thus lose the original file uploaded
>
I haven't tried it, but if you set dbio=False in form.accepts, I assume it
won't touch the file at that point. You can then handle the tb_1 update
manually after the tb_2 insert in the try block.
Anthony