Some of the information here may be outdated, please check the book instead
[edit]

Assuming....

db.define_table('mytable',...)

and the id of the source record is source_id, you can do:

# get the record
row=db(db.mytable.id==source_id).select()[0]
# set the default for all fields by ID
for fieldname in db.mytable.fields:
    if fieldname!='id': db.mytable[fieldname].default=row[fieldname]
form=SQLFORM(db.mytable)
© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.