Look at this example (at the book's crud - methods):
A('edit:',id,_href=URL(args=(request.args(0),id)))
I think you need to pass a sequence to args (<table name>, <id>) for
the required behavior. Not sure really, as I didn't use the example.
On Mar 7, 7:15 am, Gian Luca Decurtins <[email protected]> wrote:
> 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