[web2py] Re: Field vs id

2012-01-04 Thread JF
It is not exactly identical, but changing the following line in my controller item.py, function edit: thispage = db.table[request.args(0)] with: thispage = db(db.table.fieldname==request.args(0)).select().first() provides me with the result I was waiting for for a URL like:

[web2py] Re: Field vs id

2011-12-29 Thread Alan Etkin
Here is a way of editing records with non id fields: In the view construct a URL with the record's field value: {{ =A(edit, URL(controller, edit function, table name, field value)) }} Then, on the controller, you have to get the record by the field value: r = db(db[request.args(0)].field name