Hi!
I want to submit more than one record to a table from the form.
e.g. i have the following tables in the db:
db.define_table('book',
Field <http://127.0.0.1:8000/examples/global/vars/Field>('title')*)
**
*db.define_table('author',
Field <http://127.0.0.1:8000/examples/global/vars/Field>('name')
Field <http://127.0.0.1:8000/examples/global/vars/Field>('book', 'reference
book'))
and function:
def submit():
form=SQLFORM
<http://127.0.0.1:8000/examples/global/vars/SQLFORM>.factory(db.book,db.author)
if form.process().accepted:
id = db.book.insert(**db.book._filter_fields(form.vars))
form.vars.book=id
id = db.author.insert(**db.author._filter_fields(form.vars))
response
<http://127.0.0.1:8000/examples/global/vars/response>.flash='Thanks for filling
the form'
return dict(form=form)
As result of submitting this form I gets by one record in each tables.
How could I add more than one author of the book from the form without
adding the authors in advance?
Thanks
--
---
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.