If you are using the form to summiting data. You can use form vars to summiting data into multiple tables. form = SQLFORM(...) if form.process().accepted: db['table name'].insert(**form.vars)
Even you only want to insert a specific field to the table you can do so. db.['table name'].insert(filename = form.vars.filename) Thanks SP On Wed, Feb 27, 2019 at 4:03 PM Константин Комков <fireandmi...@gmail.com> wrote: > I insert file in table and then I want to write its name in another table. > How can I return filename? >> >> >>> db_app.doc_images.insert(file=request.vars.files[i]) >> 1 (I got id) > > > > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > 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/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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/d/optout.