[web2py] One form for multiple tables

2018-01-08 Thread Yoel Benítez Fonseca
I have a crear idea on how to use: http://web2py.com/books/default/chapter/29/07/forms-and-validators#One-form-for-multiple-tables But how to do the same for a edit form? Is posible to tell to SQLFORM.factory with are the current values of the fields ? Until now what i do is: - Copy the fiel

Re: [web2py] one form for multiple tables - updating record

2011-07-11 Thread Kenneth Lundström
def display(): record = db.person(request.args(0)) form=SQLFORM.factory(db.person, db.affiliation, db.address, db.card, record) if form.accepts(request.vars, session): record.update_record(**dict(form.vars)) return dict(form=form) The problem is that your are g

[web2py] one form for multiple tables - updating record

2011-07-11 Thread niknok
I've read the section about "one form for multiple tables" and following the example created my function that updates four tables: def register(): form=SQLFORM.factory(db.person, db.affiliation, db.address, db.card) if form.accepts(request.vars): id = db.person.insert(**db.person

Re: [web2py] One form for multiple tables

2011-03-02 Thread Richard Vézina
See keepvalues in book, it should help with this objective... Richard On Wed, Mar 2, 2011 at 1:06 PM, annet wrote: > This example is taken from the web2py manual. > > model: > > db.define_table('client', >     Field('name')) > db.define_table('address', >    Field('client',db.client,writable=Fal

[web2py] One form for multiple tables

2011-03-02 Thread annet
This example is taken from the web2py manual. model: db.define_table('client', Field('name')) db.define_table('address', Field('client',db.client,writable=False,readable=False), Field('street'),Field('city')) controller: def register(): form=SQLFORM.factory(db.client,db.addres