I've tried the Anthony's idea and it worked, with one difference, though:
the id could not be any value. It just worked putting the id with the same
value of request.arg(0). I think that has some relation with the hidden
input in custom forms where you have to put the id of the instance that are
Hi guys, sorry about reopen this conversation, but I got stuck in a similar
situation. My code is almost equal to Annet's code, except that I'm using a
custom form and I have to pass session=None and formname to form.process().
However, I have a field that has to be unique. So, form.process() do
Hi Angelo,
I am glad you solved your problem.
I found a way to add automatically variables to form.vars, hope this helps!
>
> record = db(...).select().first()
>
> for table in [db.table1, db.table2]:
> for field in table.fields:
> form.vars[field] = record[table][fiel
To Massimo,
I think this should be in the book after this
http://web2py.com/books/default/chapter/29/07#One-form-for-multiple-tables
Thanks!
2013/1/29 Angelo Compagnucci
> Hi Annet!
>
> This is freaking awesome and it worked like a charm!
>
> I found a way to add automatically variables to fo
Hi Annet!
This is freaking awesome and it worked like a charm!
I found a way to add automatically variables to form.vars, hope this helps!
record = db(...).select().first()
for table in [db.table1, db.table2]:
for field in table.fields:
form.vars[field] = record[tabl
I solved a similar problem the following way:
# retrieve records
node=db(db.node.id==id).select(db.node.ALL).first()
address=db(db.address.nodeID==id).select(db.address.ALL).first()
telecom=db(db.telecom.nodeID==id).select(db.telecom.ALL).first()
# build form
form=SQLFORM.factory(db.node,db.addre
6 matches
Mail list logo