Hi all
I would like to use CRUD to display a list of locations. If I press on the
location.name it should call the function update() passing location.id as
parameter.
I've taken the CRUD manage() example from the web2py book [1] and modified
it to:
@auth.requires_signature()
def select():
db.location.id.readable = False
db.location.name.represent = lambda name, row: \
A(name,_href=URL('update',args=(name),user_signature=True))
form = crud.select(table=db.location)
return dict(form=form)
Using the code above it will call update(), but passes the location.name as
parameter.
I've already tried replacing args=(name) with args=(db.location.id) or
args=(id), without success.
How is the recommended way to .represent the name-Field using the id-Field
for the link?
Regards
-Luca.
[1] http://web2py.com/book/default/chapter/07#Methods