> So if I could generate one form that allows you to create a customer, 
> complete with address, the management would become much more logical. 

In this case I'd use SQLFORM.factory:

def create():
    form=SQLFORM.factory(db.customer,db.address)
    if form.process().accepted:
        id = db.customer.insert(**db.customer._filter_fields(form.vars))
        form.vars.customer=id
        id = db.address.insert(**db.address._filter_fields(form.vars))
    return dict(form=form)

See the book: 
http://www.web2py.com/books/default/chapter/29/7?search=insert%28**#One-form-for-multiple-tables


Regards Annet.

Reply via email to