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
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
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
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
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
5 matches
Mail list logo