db.define_table('client',
Field('name'))
db.define_table('address',
Field('client','reference client',
writable=False,readable=False),
Field('street'),Field('city'))
controller:
def register():
form=SQLFORM.factory(db.client,db.address)
if form.process().accepted:
id = db.client.insert(**db.client._filter_fields(form.vars))
form.vars.client=id
id = db.address.insert(**db.address._filter_fields(form.vars))
response.flash='Thanks for filling the form'
return dict(form=form)
The user creates a record of 'client', and corresponding to this client he want to add multiple 'address' records. How to achieve this in ONE submit form? Any idea will be welcome, if too much work to create sample codes. From what I understood in the book this example only shows how to generate one form of multiple tables but not addressing issue of one-to-many relation.
Cheers.
Lio
--
---
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.