That a major issue to me to migrate to SQLFORM.grid! I would not show the ID of the record to my user.
I had a similar issue with crud.select or SQLTABLE in the pass and solve it like this : db[request.args(0)].fieldThatServeAsIDRepresent.represent=\ lambda fieldThatServeAsIDRepresent, record: A(some_dict[fieldThatServeAsIDRepresent],\ _href=URL(r=request,f='read',args=(request.args(0),str( record.id)))) form = crud.select(db.table) form = remove_id_column_func(form) But I think that this approach doesn't work with SQLFORM.grid since it really need the ID Richard On Thu, Nov 15, 2012 at 2:42 PM, Niphlod <niph...@gmail.com> wrote: > I think that the error refers to the id column being readable=False, that > is not supported. > > > On Thursday, November 15, 2012 8:16:43 PM UTC+1, software.ted wrote: > >> Thanx, it was as you pointed out. But how can I correctly use the modal >> window. It's working but the code is quiet dirty. >> On Nov 15, 2012 9:03 PM, "Richard Vézina" <ml.richa...@gmail.com> wrote: >> >>> I am not pretty experienced with SQLFORM.grid, but the way you use >>> bootstrap modal seems wrong... >>> >>> About the id problem, I notice that one time use row.id and the other >>> row.office.id maybe your problem come from there?! >>> >>> Richard >>> >>> >>> On Thu, Nov 15, 2012 at 12:58 AM, Teddy Nyambe <softwa...@gmail.com>wrote: >>> >>>> Hi, >>>> >>>> I have the following action in the controller, doing a join to display >>>> "office name" and a reference to department of "department name" to >>>> which office belongs...but i have an error in the link since I have a >>>> modal window am opening to edit/add/delete details...this is the >>>> error: >>>> >>>> <type 'exceptions.AttributeError'> 'Row' object has no attribute 'id' >>>> >>>> >>>> def office(): >>>> db.office.id.readable = False >>>> query = ((db.office.department == db.department.id)) >>>> #((db.contact.date_of_birth < “1990-11-18”)) >>>> fields = (db.office.name, db.department.name) >>>> link = [lambda row: A('Edit', _class='btn', _role='button', >>>> _onclick='dept_edit('+str(row.**office.id <http://row.office.id> >>>> )+');',**{'_data-**toggle':'modal'}) >>>> ,lambda row: A('Delete', _class='btn', _role='button', >>>> _onclick='dept_delete('+str(ro**w.id <http://row.id> >>>> )+');',**{'_data-toggle':'**modal'})] >>>> headers = {'db.office.name': 'Office Name','db.department.name': >>>> 'Department'} >>>> default_sort_order=[db.office.**name <http://db.office.name>] >>>> >>>> form = SQLFORM.grid(query=query, headers=headers, >>>> orderby=default_sort_order ,links=link, create=False, deletable=True, >>>> editable=False, maxtextlength=64, paginate=25) >>>> return dict(form=form) >>>> >>>> How do I pass an id of a row in lambda for the link parameter of the >>>> SQLFORM.grid. >>>> >>>> Been stuck with this error for a day now!! >>>> >>>> Kind regards, >>>> >>>> Teddy L. >>>> >>>> -- >>>> >>>> >>>> >>>> >>> -- >>> >>> >>> >>> >> -- > > > > --