Hi, Not sure if there is anybody else using it or trying it, but I encounter this as a start, and hanged there for some time. In order to help starter going easier, it'd be better to correct it. Because SQLFORM class can not be modified, then just to correct the example in the book. I think the simple way is to change in display_form function: FROM:
link = URL('list_records', args='db') TO: link = URL('list_records') in list_records, strip the first prefix by dot-delimit: like: query = request.vars.query To: query = request.vars.query query = ".".join(query.split(".")[1:]) I tried it work. On Tuesday, July 12, 2011 5:08:09 AM UTC-7, jc wrote: > > Hi, > Trying to use linkto, so following example in web2py > book<http://www.web2py.com/book/default/chapter/07#Links-to-Referencing-Records> > first, > to try to understand. > > I have copied the example with person and dog tables, in particular in def > display_form(): I have > > link = URL('list_records') > form = SQLFORM(db.person, record, deletable=True, > upload=url, linkto=link, labels = {'dog.owner':"This > person's dogs"}) > > as described in the book. > > The books says the link generated will be > "/test/default/list_records/dog?query=dog.owner%3D5" but in fact the link > which appears when I visit /test/default/display_form/1 is > "/test/default/list_records/dog?query=list_records.dog.owner%3D%3D1", > i.e. there is a spurious list.records and a spurious %3D. Not surprisingly > the link doesn't work. Can anybody tell me what I am doing wrong? > > Thanks. > --