[web2py] Re: CRUD with custom links
Thanks Massimo. This works fine! -Sebastian
[web2py] Re: CRUD with custom links
Please give us an example and we can show you a concrete solution. On Jun 7, 7:51 pm, DJ sebastianjaya...@gmail.com wrote: Hi there, What is the easiest way to generate customized links on the output of a CRUD select? I want to be able to specify the column and my URL with arguments. -Sebastian
[web2py] Re: CRUD with custom links
Hi Massimo, Here's a snippet of my code: ids = [1, 2, 3, 4, 5] # I tried something like this but it does not work # db.myTable.id.represent = lambda value: A(myID, _href=URL (r=request, c='default', f='viewDetail', args=myID)) form = crud.select(db.myTable, db.myTable.id.belongs(ids), _id='myid', _class='smarttable') Let me know if you need more specific code. Thanks! -Sebastian
[web2py] Re: CRUD with custom links
this should work: ids = [1, 2, 3, 4, 5] db.myTable.id.represent = lambda id: A(id, _href=URL('viewDetail', args=id)) form = crud.select(db.myTable, db.myTable.id.belongs(ids), _id='myid', _class='smarttable') On Jun 7, 8:14 pm, DJ sebastianjaya...@gmail.com wrote: Hi Massimo, Here's a snippet of my code: ids = [1, 2, 3, 4, 5] # I tried something like this but it does not work # db.myTable.id.represent = lambda value: A(myID, _href=URL (r=request, c='default', f='viewDetail', args=myID)) form = crud.select(db.myTable, db.myTable.id.belongs(ids), _id='myid', _class='smarttable') Let me know if you need more specific code. Thanks! -Sebastian